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
  • Scenarios in which data processing is complex.
  • Scenarios in which data throughput is high.

Advantages:

  • Allows you to forward data in most scenarios.
  • Allows you to modify data forwarding rules while the rules are running.
  • Supports data filtering and processing.
  • Allows you to forward data to other Alibaba Cloud services.

    The following table Table 1 compares the data forwarding solutions for different Alibaba Cloud services.

Disadvantages:

Complex to use. You must write SQL statements and configure data forwarding rules.

See Limits on data forwarding.
Server-side subscription
  • Scenarios in which device data is only received.
  • Scenarios in which the server receives all subscribed device data of a product.

Advantages: It is easy to use and efficient.

Disadvantages: It does not support data filtering and processing.

See Limits for data forwarding.
Table 1. Comparison of data forwarding solutions for different Alibaba Cloud services
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.

  • Supports data forwarding based on HTTPS protocols.
  • Supports data forwarding in the Internet environment.

-

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.
  • Supports flexible data processing.
  • Supports multiple features.
  • No deployment is required.
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
  • Server-side subscription does not support data filtering. A server receives all messages from the devices of a product.
  • A single consumer group can process a maximum of 1,000 QPS.

For more information, see Limits for data forwarding.

  • Server-side subscription prioritizes the processing of real-time messages and degrades the processing of accumulated messages. We recommend that you make sure messages are consumed in a timely manner.
  • Server-side subscription is not applicable to scenarios in which data filtering and fine-grained processing are required. We recommend that you use a rules engine for these scenarios.

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.
  • Function Compute is applicable to scenarios in which you want to customize data processing or simplify the development and maintenance processes.
  • 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. We recommend that you take preventive measures to minimize the impact of data loss or transmission delay.