Creating a Data Subscription Task

Data subscription helps cache incremental data and provides a unified SDK interface for downstream business to subscribe to and consume the incremental data.

A subscription task can be subscribed to by only one downstream SDK interface. If multiple downstream SDK interfaces need to subscribe to the same RDS instance, create multiple subscription tasks using the same RDS DB instance ID.

To create a data subscription task successfully, you need implement the following two steps:

  1. Create a data subscription task on the DRS console.
  2. Use the SDK API of DRS to access the data subscription channel and subscribe to and consume incremental data.

This section describes how to create a data subscription task on the DRS console.

Prerequisites

  • You have logged in to the DRS console.
  • Your account balance is greater than or equal to ¥0.
  • The constraints on data subscription are met. For details, see Before You Start.

Procedure

The following uses MySQL as an example to describe how to create a subscription task. To configure subscription tasks of other DB engines, you can refer to the following procedures.

  1. On the Data Subscription Management page, click Create Subscription Task.
  2. On the Subscription Source page, configure information about the task, recipients, and subscription source. Then, click Next.

    Figure 1 Subscription task information
    Table 1 Task and recipient description

    Parameter

    Description

    Task Name

    The task name consists of 4 to 50 characters, starts with a letter, and can contain only letters (case-insensitive), digits, hyphens (-), and underscores (_).

    Send Notifications

    This parameter is optional. If this function is enabled, DRS will send notifications to specified recipients based on the mobile numbers and email addresses you provided. If an exception occurs during subscription, the system will send a notification to the specified recipients.

    NOTE:

    Recipients must confirm the subscription on the SMN console within 48 hours of receiving an SMS message or email. Otherwise, they cannot receive notifications from DRS.

    Description

    The description consists of a maximum of 256 characters and cannot contain the following special characters: !=<>'&"

    Figure 2 Subscription source information
    Table 2 Subscription source information

    Parameter

    Description

    Instance Type

    Select RDS DB Instance.

    Source DB Engine

    Select MySQL.

    RDS DB instance

    The RDS DB instance you created.

    Tags

    This setting is optional. Adding tags helps you better identify and manage your task. Each task can have up to 10 tags.

    After a task is created, you can view its tag details on the Tags tab. For detailed operations, see Tag Management.

  3. On the Select Subscription Object page, wait until the instance is successfully created, select the data subscription object, and click Next.

    Figure 3 Subscription objects
    Table 3 Subscription objects

    Parameter

    Description

    Subscription Type

    Subscription types include data update and structure update.

    Subscription Object

    Only tables can be subscribed. You can select subscription objects based on your service requirements.

    If the source database is changed, click in the upper right corner before selecting migration objects to ensure that the objects to be selected are from the changed source database.

  4. On the Confirm Task page, confirm that the configured information is correct, select the check box before the agreement, and click Submit to submit the task.
  5. After the task is submitted, view and manage it on the Data Subscription Management page.

    • You can view the task status. For more information about task status, see Task Status.
    • You can click in the upper-right corner to view the latest task status.

    After a subscription task is created, you can use an SDK to subscribe to incremental data in the subscription task in real time. For details, see SDK Operation Instructions.