In multiple scenarios, you must process the data that is submitted by devices to IoT Platform or use the data for business applications. IoT Platform allows you to forward device data by using the server-side subscription feature or the feature of data forwarding to an Alibaba Cloud service. This topic describes the scenarios in which the data forwarding features can be applied, and the advantages and disadvantages of the features. You can select a feature based on your business requirements.

Data forwarding features

Feature Description References
Data forwarding to an Alibaba Cloud service Supports basic data filtering and processing. You can configure data forwarding rules to filter and process device data, and then forward the data to other Alibaba Cloud services. Configure a data forwarding rule
Server-side subscription Allows you to obtain device messages by using an Advanced Message Queuing Protocol (AMQP) or Message Service (MNS) client. The server-side subscription feature is easy to use and efficient. However, you cannot use the feature to filter and process device messages.

Comparison of features and solutions

Feature Comparison

Feature Scenario Advantage Disadvantage Limits
Data forwarding to an Alibaba Cloud service
  • You can use this feature to forward device data to a topic or an Alibaba Cloud service for storage or processing.
  • You can use this feature when you want to forward a large amount of data.
  • This feature can meet most of your business requirements.
  • This feature allows you to modify data forwarding rules without interrupting the running rules.
  • This feature supports basic data filtering and processing.
  • You can use this feature to forward data to other Alibaba Cloud services.

    For more information about how to forward data to other Alibaba Cloud services, see Comparison of solutions in which data is forwarded to different Alibaba Cloud services.

This feature requires technological expertise because you must write SQL statements and configure data forwarding rules.

For more information about the limits, see Limits on data forwarding.
Server-side subscription
  • You can use this feature when you only want to receive device data.
  • You can use this feature when you want the server to receive all subscribed device data of a product.

This feature is easy to use and efficient.

You cannot use this feature to filter and process data.

  • You cannot use the server-side subscription feature to filter data. A server receives all messages from the devices of a specific product.
  • A single consumer group can process up to 1,000 queries per second (QPS).

For more information about the limits, see Limits on server-side subscriptions.

Comparison of solutions in which data is forwarded to different Alibaba Cloud services

Data Destination Scenario Advantage Disadvantage References
Message Queue for Apache RocketMQ You can forward device data to Message Queue for Apache RocketMQ when you want to perform fine-grained processing on the data from a large number of devices.

When the throughput of device data exceeds 1,000 QPS, we recommend that you forward device data to Message Queue for Apache RocketMQ.

  • This solution is reliable and stable.
  • This solution supports a large amount of data.
Message Queue for Apache RocketMQ has less satisfactory performance when you access Alibaba Cloud services over the Internet. Enterprise Platinum Edition instances provide better performance than Standard Edition instances.
MNS You can forward device data to MNS if you want to perform fine-grained processing on the device data when you access Alibaba Cloud services over the Internet.

When the throughput of device data is less than 1,000 QPS, we recommend that you forward data to MNS.

  • This solution supports data transmission over HTTPS.
  • MNS has more satisfactory performance when you access Alibaba Cloud services over the Internet.

However, MNS provides slightly poorer performance than Message Queue for Apache RocketMQ.

ApsaraDB RDS You can forward device data to ApsaraDB RDS when you only want to store the data. Data is written to databases. N/A
Time Series Database (TSDB) You can forward device data to TSDB when you want to analyze and monitor your business based on the device data. Data is written to TSDB. N/A
Tablestore You can forward device data to Tablestore when you only want to store the data. Data is written to Tablestore. N/A
Function Compute You can forward device data to Function Compute when you want to simplify the device development process and process the device data in a flexible manner.
  • You can use Function Compute to process data in a more flexible manner.
  • Function Compute provides multiple features.
  • Function Compute does not require deployment workloads.
The costs of Function Compute are slightly higher than those of other solutions.

Usage notes

Server-side subscription

Feature description Remarks
A server can use AMQP SDK or MNS SDK to receive all subscribed device messages of a product. The device messages include upstream messages and messages about status changes, lifecycle changes, historical TSL data, status of over-the-air (OTA) updates, gateway and sub-device connections, and topological changes.
  • The server-side subscription feature preferentially processes real-time messages over accumulated messages. Make sure that messages are consumed at the earliest opportunity.
  • You cannot use the server-side subscription feature in scenarios where data filtering and fine-grained processing are required. We recommend that you use a rules engine in these scenarios.

Data forwarding to Message Queue for Apache RocketMQ

Feature description Limits Remarks

You can forward messages from a specified topic in IoT Platform to a topic in Message Queue for Apache RocketMQ. Then, you can use Message Queue for Apache RocketMQ SDK to receive the messages.

  • Message Queue for Apache RocketMQ provides outstanding data processing capabilities. We recommend that you use Message Queue for Apache RocketMQ to receive device messages.
  • Message Queue for Apache RocketMQ supports cross-account authorization on topics. You can use Message Queue for Apache RocketMQ to forward data across Alibaba Cloud accounts.
  • You cannot use Message Queue for Apache RocketMQ test clusters that are accessed over Internet in the production environment.
  • You cannot debug Message Queue for Apache RocketMQ that is accessed over internal endpoints locally. You must debug Message Queue for Apache RocketMQ that is deployed in an Elastic Compute Service (ECS) instance. The ECS instance must reside in the region where your IoT Platform service runs.
  • Developers can use Message Queue for Apache RocketMQ test clusters that are accessed over the Internet to receive messages. However, the service is unstable. We recommend that you do not use the test clusters in the production environment.
  • When the throughput of device messages exceeds 5,000 QPS or you require high service stability, we recommend that you use Enterprise Platinum Edition instances of Message Queue for Apache RocketMQ.
  • 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. To minimize the impact of data loss or transmission delay, we recommend that you take preventive measures.

Data forwarding to MNS

Feature description Limits Remarks

You can forward messages from a specified topic in IoT Platform to a topic in MNS. Then, you can use MNS SDK to receive these messages. You can access MNS over the Internet. When the throughput of device messages is less than 1,000 QPS, we recommend that you use MNS.

For more information about the limits on MNS topics, see Limits.

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. To minimize the impact of data loss or transmission delay, we recommend that you take preventive measures.

Data forwarding to Function Compute

Feature description Limits Remarks

You can forward messages from a specified topic in IoT Platform to Function Compute. Then, you can use Function Compute to process these messages. Function Compute is a fully managed service that simplifies business development.

For more information about the limits on Function Compute, see Limits.
  • You can forward data to Function Compute in scenarios where you want to process the data based on your business requirements or simplify development and O&M.
  • 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. To minimize the impact of data loss or transmission delay, we recommend that you take preventive measures.