Does Microsoft Azure IoT Hub stores data?

DSA picture DSA · Oct 9, 2015 · Viewed 8.4k times · Source

I have just started learning Azure IoT and it's quite interesting. I am confuse about does IoT Hub stores data somewhere?

i.e. Suppose i am passing room Temperature to IoT hub and want to store it in database for further use. How it's possible?

I am clear on how device-to-cloud and cloud-to-device works with IoT hub.

Answer

ppatierno picture ppatierno · Oct 9, 2015

IoT Hub exposes device to cloud messages through an event hubs endpoint. Event Hubs has a retention time expressed in days. It's a stream of data that the reading client could re-read more time because the cursor is on client side (not on server side like queues and topics). With IoT Hub the related retention time is 1 day by default but you can change it.

If you want to store received messages from device you need to have a client reading on the Event Hubs exposed endpoint (for example with an Event Processor Host) that has the business logic to process the messages and store them into a database for example.

Of course you could use another decoupling layer so that the client reads from event hubs and store messages into queues. Then you have another client that at its own pace reads from queues and store into database. In this way you have a fast path reading event hubs.