Among the Azure bricks, there are 2 elements particularly interesting for the communication of information in the field of IoT, we have the “Event Hub” and the “IoT Hub”. In this article we will compare these services in order to deduce the appropriate usage scenarios for each.

Azure IoT Hub

Rely on Azure IoT Hub to easily and securely connect your Internet of Things (IoT) assets. Use device-to-cloud telemetry data to understand the state of your devices and assets, and be ready to take action when an IoT device needs your attention. In cloud-to-device messages, reliably send commands and notifications to your connected devices—and track message delivery with acknowledgement receipts. Device messages are sent in a durable way to accommodate intermittently connected devices.

IOT Hub

Azure Event Hub

Azure Event Hubs is a highly scalable data streaming platform and event ingestion service, capable of receiving and processing millions of events per second. Event Hubs can process and store events, data, or telemetry produced by distributed software and devices. Data sent to an event hub can be transformed and stored using any real-time analytics provider or batching/storage adapters.

Event Hub

Event Hub vs IoT Hub

Technical differences

Overall these 2 services have similar attributes, they are designed to work with a high data rate, a low latency but see here a comparison of the technical differences:

IoT Hub

Event Hub

Communication

bidirectional

Unidirectional

protocols

AMQP

AMQP WebSocket

HTTP / 1

MQTT

AMQP

AMQP WebSocket

HTTP / 1

security

Works with an identity book

and access control for devices

communicating

Provides shared access policies between devices

Observation of communications

A panel of events is provided between device connectivity, authentication and communication, alerting specifically to any failure.

Only has a Hub scale metric graph

scaling

Support for millions of connected devices simultaneously

Up to 5000 AMQP connections

Use case

In reality, these Hubs have not always competed. The Event Hub was the tool specialized in the “telemetry and event” processing and therefore predestined to be used for IoT, as part of a Device-> Cloud communication.
However, as the need for IoT grows, a new solution has been introduced, the IoT Hub, a hub entirely designed for the domain taking the place of the Event Hub in Device -> Cloud communication.
Today it is recommended to use the IoT Hub for messages from devices to the cloud, taking advantage of the bidirectional channel for a possible response to the devices, and to use the event hub for event management. generated by massive data processing.

Example: Alert generated by a device, after analysis of its recovered data or simply for the analysis of devices in real time on a dashboard.

Conclusion

We can now clearly distinguish the use of both tools.

The IoT Hub is a complex and particularly complete element for IoT scenarios, it is the entry point for the communication of devices to the cloud. While the Event Hub is a very simple tool to master, allowing a rather efficient event management from the cloud to a dashboard or a client notification service.