Creating a Data Subscription Task
Supported Databases
DB Engine |
Data Type |
---|---|
RDS for MySQL Version 5.6 and 5.7 |
|
A subscription task has many subscription object and operation constraints. You are advised to use data synchronization from MySQL to Kafka with higher performance and stability for data subscription.
- For details about the differences between data subscription and synchronization from MySQL to Kafka, see What Are Differences Between Data Subscription and Synchronization from MySQL to Kafka?
- For more synchronization scenarios to Kafka, see Synchronization Overview.
Precautions
You can create a subscription task to obtain the data change information of key services in the database. This type of information is often required by downstream services. Data subscription helps cache incremental data and provides a unified SDK interface for downstream applications to subscribe to and consume the incremental data.
To create a data subscription task successfully, you need implement the following two steps:
- Create a data subscription task on the DRS console.
- Use the SDK API of DRS to access the data subscription channel and subscribe to and consume incremental data.
The following describes constraints on data subscription tasks. Before using DRS, you need to ensure that the source and destination databases meet the following constraints.
Type |
Restrictions |
---|---|
Restrictions on subscription objects |
|
Precautions |
|
Prerequisites
- You have logged in to the DRS console.
- Your account balance is greater than or equal to $0 USD.
- For details about the supported database types and versions, see Supported Databases.
- If a subaccount is used to create a DRS task, ensure that an agency has been added. For details about how to create an agency, see Agency Management.
Procedure
This section describes how to create a data subscription task on the DRS console.
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.
- On the Data Subscription Management page, click Create Subscription Task.
- On the Select Subscription Source page, specify Region, Task Name, Description, and subscription source details, and click Next.
Figure 1 Subscription task information
Table 3 Task and recipient description Parameter
Description
Region
The region where your service is running. You can change the region. To reduce latency and improve access speed, select the region closest to your services.
Project
The project corresponds to the current region and can be changed.
Task Name
The task name must start with a letter and consist of 4 to 50 characters. It can contain only letters, digits, hyphens (-), and underscores (_).
Description
The description consists of a maximum of 256 characters and cannot contain special characters !=<>'&"\
Figure 2 Subscription source information
Table 4 Subscription source information Parameter
Description
Instance Type
Select RDS DB instance.
Source DB Engine
Select MySQL.
RDS DB instance
Select an RDS DB instance you have created.
Enterprise Project
An enterprise project you would like to use to centrally manage your cloud resources and members. Select an enterprise project from the drop-down list. The default project is default.
For more information about enterprise projects, see Enterprise Management User Guide.
To customize an enterprise project, click Enterprise in the upper right corner of the console. The Enterprise Project Management Service page is displayed. For details, see Creating an Enterprise Project in Enterprise Management User Guide.
Tags
This setting is optional. You can use tags to manage subscription tasks. Each task can have up to 20 tags.
If your organization has configured tag policies for DRS, add tags to tasks based on the policies. If a tag does not comply with the policies, task creation may fail. Contact your organization administrator to learn more about tag policies.
After a task is created, you can view its tag details on the Tags tab. For details, see Tag Management.
If a task fails to be created, DRS retains the task for three days by default. After three days, the task automatically stops.
- 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 5 Subscription objects Parameter
Description
Subscription Type
Subscription types include data update and structure update.
- Data update
Subscribes to the Incremental updates of the selected data.
- Structure update
Subscribes to the structure creation, deletion, and modification of all objects in an instance, SDK is needed to filter the required data.
Subscription Object
Currently, data subscription objects support only tables. You can select a subscription object 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.
You can also search for subscription objects to quickly select the required objects.
- Data update
- On the Confirm Task page, specify Send Notifications and SMN Topic, confirm that the configured information is correct, select the check box before the agreement, and click Submit.
Figure 4 Task startup settings
Table 6 Task startup settings Parameter
Description
Send Notifications
This parameter is optional. After enabled, select a SMN topic. If the status or latency metric of the data subscription task is abnormal, DRS will send a notification.
SMN Topic
This parameter is available only after you enable Send Notifications and create a topic on the SMN console and add a subscriber.
For details, see Simple Message Notification User Guide.
Synchronization delay threshold
A synchronization delay indicates a time difference (in seconds) of synchronization between the source and destination database.
If the synchronization delay exceeds the threshold you specify, DRS will send alarms to the specified recipients. The value ranges from 0 to 3,600. To avoid repeated alarms caused by the fluctuation of delay, an alarm is sent only after the delay has exceeded the threshold for six minutes.
NOTE:- Before setting the delay threshold, enable Send Notifications.
- If the delay threshold is set to 0, no notifications will be sent to the recipient.
- 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 Statuses.
- You can click in the upper-right corner to view the latest task status.
- By default, DRS retains a task in the Configuration state for three days. After three days, DRS automatically deletes background resources, but the task status remains unchanged. When you reconfigure the task, DRS applies for resources again.
- By default, DRS retains a task in the Abnormal state for 14 days. After 14 days, DRS automatically deletes background resources, but the task status remains unchanged. When you reconfigure the task, DRS applies for resources again.
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 about the operations and precautions, see SDK Usage Instructions.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot