Serverless architecture in Azure

It is decided to implement our application as a serverless architecture using FaaS by Azure following the event-based cloud programming model. We will leverage the Azure Functions to build our processing logic.

We will use some of the Azure products in our architecture, so let's just quickly see their definitions before we draw the architecture diagram.

Azure Functions: They process events with a serverless code, and are fully scalable on demand, automatically. In this architecture, we will use them to execute some logic based on certain events. Note that the IoT Hub to Azure Function functionality is still newly released, otherwise, we connect from IoT Hub –> Event Hub –> Azure Function.

For more information on the topic of Azure Function and IoT Hub, please browse through the following site: https://azure.microsoft.com/en-us/blog/azure-iot-gateway-sdk-integrates-support-for-azure-functions

Event Hubs: These can (only) receive millions of events per second, and are fully scalable. They enable you to ingress massive amounts of telemetry into the cloud. In this architecture, we will use Event Hubs to receive messages from smart devices based on the iOS, Android, and Windows operating systems.

Notification Hub: It's a cloud-scale push notification engine to send (only) push notifications (millions of messages) to any platform. Here we will use it to send messages from Azure Function in the cloud to smart devices based on the iOS, Android, and Windows operating system.

Note that (as of now) to allow Azure Function to send messages to the IoT Hub, we need to include the NuGet package Microsoft.Azure.Devices in the Project.json file. Currently, it supports .NET 4.6

IoT Hub: It allows us to connect, monitor, and manage billions of IoT devices. It enables us to have reliable, bi-directional, real-time communication. It supports a broad set of operating systems and protocols, which is why we are using it here. We use it in our architecture to talk to our Home Hub, which runs some micro-operating system, let's say a tiny-sized Linux box which is able to communicate via the C language.

DocumentDB: It's a NoSQL-document-oriented database-as-a-service (BaaS). It's a super-fast, planet-scale NoSQL DB, which you can query using the familiar SQL and JavaScript syntax over document and key-value data without dealing with schema. Here we are using it to store quickly millions of messages in a schema-less database to be processed at later stage, say, for example, Big Data.

Stream Analytics: It enables real-time stream processing of the events received from such as Event Hubs. It allows performing of real-time analytics for your IoT solutions. Here we use it just to demonstrate the idea that with Azure IoT solutions, we can perform real-time analysis on a stream of data ingress, and push back the notifications to our customers.

Blob storage: It's a cloud-scale object storage for unstructured data (images, videos, audio, documents, and so on). In our design, it is required to receive data from Stream Analytics, which will later trigger our respective Azure Function.

Finally, this image depicts our serverless architecture ready for implementation:

Serverless architecture for a sample IoT Home Automation app
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.129.253