Event Hub Vs IOT Hub - Kshitijkesri/WiredBrainCoffeeMachine GitHub Wiki

As you have learned so far, you can use an Azure Event Hub to collect telemetry data from your applications and devices. An Azure IoT Hub supports a similar concept. You can send events from your devices to an IoT Hub. The events in the IoT Hub can also be consumed, for example, by a Stream Analytics job. Now you might ask yourself, what are the key differences between an Event Hub and an IoT Hub? The IoT Hub is made for devices. Beside the device to cloud communication, it supports also a cloud to device communication. So, when you set the two in comparison, we have the communication which is device to cloud for the Event Hub, and device to cloud and also cloud to device for the IoT Hub. Another difference between the two are the supported protocols. The Event Hub supports HTTPS and the advanced message queuing protocol, or short, AMQP. The IoT Hub also supports HTTPS and AMQP, but also the so-called message queuing telemetry transport protocol, or short, MQTT, which is a standard client server protocol supported by many IoT devices. When it comes to concurrent AMQP connections, the standard Event Hub supports up to 5000 while an IoT Hub is optimized for millions of simultaneously connected devices. When you work with devices, another important thing can be a device management. An Event Hub does not have such a device management, but an IoT Hub has an integrated device management for typical scenarios. These scenarios can be, for example, rebooting a device, forcing a factory reset, or installing the firmware update. Also interesting is the authentication. While an Event Hub is using a shared access key, an IoT Hub supports an individual authentication per device. So you see, an IoT Hub has many additional features specific for devices. Under the hood, it pretty much acts like an Event Hub and also allows you to collect telemetry data. But if you don't need all the device-specific features of an IoT Hub, and you only want to collect telemetry data, then an Event Hub is a great choice and also much cheaper than an IoT Hub, because an Event Hub is focusing on that single scenario, collecting telemetry data. Now let's switch to the architecture again. It is not uncommon to use an IoT Hub and an Event Hub in a single solution. If you have devices, the devices could connect directly to an IoT Hub like here. As you have already an IoT Hub for your devices, you might not want to connect them also to an Event Hub in addition. But your applications would still send directly to the Event Hub. Applications can also be services in Azure that collect data from other places and push that data to the Event Hub. Now the data from the IoT Hub might be pulled from a separate Stream Analytics job and that job pushes the data from the devices into the Event Hub. It could aggregate the data if needed. In the Event Hub, you have now all the data and you can process from there with the Stream Analytics job that sits behind that Event Hub