I have designed IOT platform based on Open-source projects and tools.
Technology and Open-Source Project used
- MongoDB (NoSQL Database)
- MySQL (SQL Database)
- NodeJS (Application engine)
- ReactJS (UI Design)
- MQTT (Messaging protocol)
- HTTPS (API protocol)
- Ubuntu (OS)
- AWS (Cloud Service)

Basic Understanding of design
In the center of design Linux system is there where I have installed all the components. I have used Ubuntu as my base Operating system. If you see in the design there is one component in the center named Gateway. Which is the most important component of IOT system design. Gateway is nothing but MQTT Server which I used as my central messaging protocol. (More details on this in below section)
All the devices (which are actually hardware components which run on Arduino) need to configure with Gateway address so that they can send messages to Gateway when there is change in status or whatever messages needs to be sent. All these devices should have access of internet. (I have installed GSM in all devices so that they can connect to cloud and send messages). Also, not any random devices or anyone from the internet can send messages to my Gateway so we have also applied authentication to connect Gateway. All devices need to be successfully authenticated to send messages to Gateway.
Here, as discussed earlier, all the messaging part is handled by Gateway and registered IOT Devices. Now there is one more important component which is the rule engine. We get thousands of messages from each device but not all messages are important to acknowledge end user. So here we have a rule engine where the user can configure all messages they want to acknowledge.
I have stored all the messages coming from each device into MongoDB (which is NoSQL database) and all the alert filtered by rule engine stored in MySQL (which is relational database).
Mobile App/Web application which can provide live status of all the IOT devices. All the historical data also can be explored from this application. You can also send messages or tasks to IOT device from mobile applications. For example, we have implemented this design for smart homes and now want to switch off fans or lights. User click/send command from application. Which goes to Gateway and gateway send message to that particular device.
This design can be used for all the IOT scenarios, Few examples
- Smart Energy meter -> I have implemented this, please watch below video to see functionality on this
- Smart Home
- Smart Fridge
- Temperature Sensor/Wind Sensor/ Rail sensor
- Device installed in Car (Light or heavy weight vehicle)
- Device installed in Locomotive
Few more use cases

Detailed understating of each component in design
What is Gateway or Messaging broker?
I have used MQTT protocol for messaging purposes. So, I have installed MQTT server, which is responsible for sending and receiving all the messages. Gateway works as postman. Where it gets all the messages from IOT devices (in this image, you can consider IOT device as M1, M2,…) And once message is received, Gateway will deliver this message to interested party.
How MQTT protocol work?
It uses the subscribe and publish method (Sub and Pub). First any device/application needs to subscribe to server if they are interested in getting message. Once any application/s subscribes to that message then it is MQTT server’s responsibility to successfully deliver message to them. For example, let’s say on Facebook you subscribe to any group or page and when there is update you get notification, this is exactly same thing.
In this scenario, User A is having device M1 and M2. So, User A’s application (Mobile or Web) subscribes to topic M1 and M2. Now if there is any change in status of device M1 and M2, it sends message to MQTT server (Gateway). And now Gateway knows that User A has registered/subscribed for M1 and M2, so immediately it sends an update to User A that there is change in status of these device.
What is Rule engine?
When devices register on Gateway, they continuously send messages to Gateway. For example, we have a temperature sensor which sends temperature data to Gateway. The user is not interested or getting notified for all the temperature data but for example when temperature is more than 40 degrees Celsius then only, he wants to notified. So, we have Rule engine, where user can define rule, that when temperature is more than 40, he/she should be notified. So, Gateway gets all the messages and then it applies the rule and if there is any message which is passing rule, it will send notification to that user.
So, Rule engine is fully configural, where user can create different types of rules and it can take different types of action. Once rule is fulfilled it can send Text message or send mail or can be notified with push notification.
What is the use of MongoDB database?
MongoDB is a NoSQL Database. Here I used to store all the messages which were coming from devices. And this data can be used to do historical analysis and can be used for Data Science use case. The volume of data is too high, that’s why I used NoSQL database.
Reason of using NoSQL Database for storing all messages
- Cost, NoSQL Database is cheap compare to SQL database
- More efficient for insert scenario compare to SQL Database
- Volume is very high and NoSQL Database can be easily scalable.
What is the use of MySQL Database?
MySQL is SQL Database and very efficient for reading data. Here, I used MySQL Database for storing user details, application configuration, which device owned by which user, rule engine details, latest status of IOT device.
UI Application?
Web Application was designed using React JS. You can have details on below video.
APIs Engine?
API engine is designed in NodeJS. All the APIs related to user, device or configuration was all done in NodeJS.
Fully function IOT system design based on this architecture.
IOT Smart Energy Meter
As per the latest design, below technologies can be used for designing IOT Architecture
- Apache Kafka
- Azure Event Hub
- Azure IOT Hub
- Apache Strom
- Google Pub/Sub
- AWS Kinesis streaming
Azure Design for IOT

AWS Design for IOT

Google’s Design for IOT

Please comment below if you need more details on IOT design or if you have any questions.
hi, we are manufacture of smart home product based on zigbee and wifi protocol and tuya and smart life
we want to have our own iot cloud with our own smart home app based on zigbee and wifi protocol with universal gateway
let me connect with you thanks
maesoumi@gmail.com