Monday, December 23, 2019

Azure IOT Hub for beginners


     Microsoft announced that we will be able run SQL Server in IOT devices soon. This new version of SQL Server is named Azure SQL Database Edge. It is not available to public yet. I heard about Azure SQL Database Edge first time in Pass Summit 2019. I have requested access to its public preview and thanks to all SQL Server Managers, I got the access last week. You need to learn couple of other technologies to use Azure SQL Database Edge. I want to introduce you Azure IOT Hub and Azure IOT Hub Edge in this post.



     Internet of Things (IOT) are everywhere. Companies always look for ways to catch any problems in their tools, cars, machines, etc...  before any problem occurs. Companies want their tools work better, more efficient and smarter. IOT devices deliver exactly that. Companies builds a simple ARM device with many sensors and install this device to their tools or machines. Sensors becomes machines senses and the network connection line becomes the mouth of machines. These IOT devices let us know if everything is going well or not with the machines.

     IOT devices need central hub so they can speak to this central hub rather than sending us directly the results of their sensor results. By using this central hub, we can listen all the IOT devices. We might need to speak them back; we might need to give them orders to do something. This central place name is Azure IOT Hub.

     Azure IOT Hub delivers you all these functionalities. All your IOT devices connect to Azure IOT Hub and send their messages. All you need to create an IOT Hub is a unique name for your hub and size and scale setting. Azure IOT Hub has a free tier, it allows you to receive 8k messages per day. You can use that option for development. After this, you can start to register your IOT devices. Azure IOT Hub generates a connection string for each device, you need to use this connection string when you setup your IOT device. You can create all kind of workflows for the received messages. You can store the data in Azure Cosmos DB, you can use any analytics tools of Azure or you can train your Machine Learning models with the messages you receive from IOT devices.

   
     Azure IOT Hub is a great solution but it can get expensive. Your devices send data to Azure IOT Hub constantly and usually the data is same data unless something is going wrong with the device. If devices have any connection problems, you lose data until problem is fixed. Usually IOT devices are in remote locations. For example, you might have a device in a jet engine flying on an ocean. How fast can you fix connection problems or any other problems you might have with this remote device?


     That's where Azure IOT Hub Edge comes into the picture. With the EDGE architecture, you give more rights to the IOT devices. You let devices run your applications in IOT devices and let them store sensors data in an IOT device. You can analyze data and do something rather than you do all that work in Azure Cloud. This model saves you a lot of connection requests and number of messages to Azure IOT Hub. You might let devices to connect once a week to Azure Cloud and send the data they have. This model saves you money and delivers more stable environment for your business. Azure SQL Database uses this model. You can install SQL Server into your IOT machine and store data locally, SQL Server comes with built-in AI support.

1 comment: