Reputation: 4010
We are building an IoT solution where we need bi-directional communication between Device and Cloud.
Azure IoT Hub seems to be a perfect fit.
However, the pricing is steep for a reasonable amount of outgoing messages/day for our needs (when compared to Event Hub).
So I was thinking of an hybrid solution where Azure IoT Hub would be used only for Cloud-to-Device messages, and Event Hub would be used for Device-To-Cloud messages.
Would this be a viable solution ?
Upvotes: 0
Views: 460
Reputation: 804
Well, it seems like the question was asked long ago, but I hope that this will be of some help to someone in the future.
I believe that choosing Event Hub for Device messages will result in losing the following capabilities that IoT Hub present:
Device Provisioning Service: The device data that a given IoT solution stores depends on the specific requirements of that solution. But, as a minimum, a solution must store device identities and authentication keys. Azure IoT Hub includes an identity registry that can store values for each device such as IDs, authentication keys, and status codes. A solution can use other Azure services such as table storage, blob storage, or Cosmos DB to store any additional device data. Device provisioning is the process of adding the initial device data to the stores in your solution. To enable a new device to connect to your hub, you must add a device ID and keys to the IoT Hub identity registry. As part of the provisioning process, you might need to initialize device-specific data in other solution stores. You can also use the Azure IoT Hub Device Provisioning Service to enable zero-touch, just-in-time provisioning to one or more IoT hubs without requiring human intervention. To learn more, see the provisioning service documentation.
Device Twin and Device Management: Device twins are JSON documents that store device state information including metadata, configurations, and conditions. Azure IoT Hub maintains a device twin for each device that you connect to IoT Hub.
In order to have a low-cost solution, I think that you should consider send a batch of telemetry data (which means sending less device to cloud messages) if that something that can still answer to your technical/functional requirements.
Upvotes: 0
Reputation: 29780
An event hub is already used under the hood but sure, it can be done. However, there are subtle differences according to the docs.
The main differences when it comes to Device to Cloud messaging:
IoT hub
protocols: Supports MQTT, MQTT over WebSockets, AMQP, AMQP over WebSockets, and HTTPS. Additionally, IoT Hub works with the Azure IoT protocol gateway, a customizable protocol gateway implementation to support custom protocols.
Device SDKs: Provides device SDKs for a large variety of platforms and languages, in addition to direct MQTT, AMQP, and HTTPS APIs.
Event Hub
protocols: Supports AMQP, AMQP over WebSockets, and HTTPS.
Device SDKs: Is supported on .NET, Java, and C, in addition to AMQP and HTTPS send interfaces.
Then there is the differences in security mechanisms and message routing (see the docs) so if using the Event Hub needs your requirements i'd say give it a go.
Summary (from docs)
In summary, even if the only use case is device-to-cloud telemetry ingress, IoT Hub provides a service that is designed for IoT device connectivity. It continues to expand the value propositions for these scenarios with IoT-specific features. Event Hubs is designed for event ingress at a massive scale, both in the context of inter-datacenter and intra-datacenter scenarios.
It is not uncommon to use both IoT Hub and Event Hubs in the same solution. IoT Hub handles the device-to-cloud communication, and Event Hubs handles later-stage event ingress into real-time processing engines.
Upvotes: 1