In multiple scenarios, you must process the data that is reported by devices to IoT Platform or use the data for business applications. IoT Platform allows you to forward device data by using one of the following solutions: server-side subscription or data forwarding. This article compares the application scenarios, advantages, and disadvantages of the solutions. You can select a solution based on your business scenarios.
IoT Platform supports the following two data forwarding solutions:
- Data forwarding: provides basic data filtering and processing capabilities. You can configure data forwarding rules to filter and process device data and then forward the data to other Alibaba Cloud services.
- Server-side subscription: allows you to directly obtain device messages by using an Advanced Message Queuing Protocol (AMQP) or Message Service (MNS) client. You can obtain device messages without the need to filter and process the messages. This feature is simple, easy to use, and efficient.
Comparison between data forwarding and server-side subscription
IoT Platform supports the following two data forwarding solutions:
- Data forwarding: You can configure data forwarding rules to filter and process device data and then forward the data to other Alibaba Cloud services.
- Server-side subscription: You can directly obtain device messages by using an AMQP or MNS client.
The following table compares the application scenarios, advantages, and disadvantages of the two solutions.
Solution | Application Scenario | Advantage and disadvantage | Limit |
---|---|---|---|
Data forwarding |
|
Advantages:
Disadvantages: Complex to use. You must write SQL statements and configure data forwarding rules. |
See Limits on data forwarding. |
Server-side subscription |
|
Advantages: It is easy to use and efficient. Disadvantages: It does not support data filtering and processing. |
See Limits for data forwarding. |
Data Destination | Application Scenario | Advantages | Disadvantages |
---|---|---|---|
Message Service (MNS) | Scenarios in which complex or refined data processing is required in the Internet
environment.
If the message processing speed is less than 1, 000 queries per second (QPS), we recommend that you forward data to MNS. |
|
- |
ApsaraDB RDS | Scenarios in which data is only stored. | Data is directly written to databases. | - |
Tablestore (OTS) | Scenarios in which data is only stored. | Data is directly written to Tablestore instances. | - |
Function Compute | Scenarios in which the device development process must be simplified and device data must be processed in a flexible way. |
|
The cost is slightly higher than other solutions. |
Server-side subscription
A server can use AMQP SDK or MNS SDK to receive device messages of the subscribed products. The device messages include upstream messages, status changes, lifecycle changes, historical TSL model statistics, OTA update statuses, gateway and sub-device connections, and topological changes.
Limit | Usage notes | Documentation |
---|---|---|
For more information, see Limits for data forwarding. |
|
Forward data to Message Service (MNS)
The data forwarding feature of IoT Platform allows you to forward messages from specified topics to the topics in MNS. Then, you can receive these messages by using MNS SDK. MNS is compatible with Internet environments. We recommend that you forward data to MNS if the message throughput is less than 1,000 QPS.
Limit | Usage notes | Documentation |
---|---|---|
For more information about the limits of MNS topics, see Limits of MNS. |
If a message fails to be forwarded, the rules engine retries to forward the message. If a specified number of retries fail, the message is discarded. Latency may occur in message-based services. We recommend that you take preventive measures to minimize the impact of data loss or transmission delay. |
Forward data to Function Compute
The data forwarding feature of IoT Platform allows you to forward messages from specified topics to Function Compute. Then, you can process the received messages. Function Compute is a fully-managed service that simplifies business development.
Limit | Usage notes | Documentation |
---|---|---|
See Limits of Function Compute. |
|