Capture IoT Data With MongoDB in 5 Minutes
Rate this article
Capturing IoT (Internet of Things) data is a complex task for 2 main reasons:
- We have to deal with a huge amount of data so we need a rock solid architecture.
- While keeping a bulletproof security level.
First, let's have a look at a standard IoT capture architecture:
On the left, we have our sensors. Let's assume they can push data every second over TCP using a and let's suppose we have a million of them. We need an architecture capable to handle a million queries per seconds and able to resist any kind of network or hardware failure. TCP queries need to be distributed evenly to the application servers using and finally, the application servers are able to push the data to our multiple routers from our .
As you can see, this architecture is relatively complex to install. We need to:
- buy and maintain a lot of servers,
- make security updates on a regular basis of the Operating Systems and applications,
- have an auto-scaling capability (reduce maintenance cost & enable automatic failover).
This kind of architecture is expensive and maintenance cost can be quite high as well.
Now let's solve this same problem with MongoDB Stitch!
And that's it! That's all we need! Our HTTP POST service can be reached directly by the sensors from the webhook provided by MongoDB Stitch like so:
Because MongoDB Stitch is capable of scaling automatically according to demand, you no longer have to take care of infrastructure or handling failovers.
Thanks for taking the time to read my post. I hope you found it useful and interesting.