Monday, February 13, 2017

Containerize your IoT

NewImage
Now, imagine that we want to scale our HomeAutomation solution.
For example, we need to design a SmartBuilding solution, a solution for a large building, like a Hotel or a large building containing hundreds of offices.
We want a solution that enable us to:
  1. Monitor the temperature in each room, to implement a smart control of heating and cooling and enable us to reduce the energy consumption;
  2. Monitor the air quality in each room;
  3. Manage a set of sensors in each room (fire, …);
  4. Manage the lights in each room remotely (for example, if no-one is inside, turn-off the lights);
  5.  …..
 This is what I would call a medium scale IoT solution.
 We can decide to adopt a four layers architecture: 
  1. Devices;
  2. Floor Gateway
  3. IoT HuB
  4. Enterprise Application

NewImage
Now, the question I want to work on is: how do you design and build what I have called the IoT HUB?
First, the most important decision: do you want to adopt a Cloud Platform or build on-premises? (Well, there is a third option: an hybrid solution, but for now let’s limit to the first two).
In a future blog post I’ll examine how to build it using a Cloud Provider. But now I want to discuss how to build it in your Data Center.

First of all, let’s recap what kind of capabilities you need: 
  1. A Messaging backbone (Message Broker), to receive all messages coming from devices and to implement the publish-subscribe pattern;
  2. A Device State (or Shadow) component, to store the latest state and messages from devices;
  3. A Message Store, to store persistently all the message received from devices (with some retention period set);
  4. A Device Registry;
  5. A Monitoring Dashboard
  6. ….

In my Home Automation previous blog posts, these are all Building Blocks hosted in my Raspberry PI, since it is enough for a House.
 But for our Smart Building solution we need:
  1. To scale-up the solution, to have enough computing power;
  2. Clusterize, to give High Availability, in case one component fails;

The design idea I’m going to explore here and in (hope to have enough time) next blog’s posts is to “Containerize your IoT”.
NewImage

In other words: the adoption a Containerization technology (here: Docker) so that each one of the Building Blocks (see list of capabilities above) I have mentioned here maps to a Container, following the “Micro-Services” Architecture Paradigm.

No comments:

Post a Comment