Data subscription is a service provided by OceanBase Cloud to obtain real-time incremental data from the database. It supports OceanBase Database (in both MySQL and Oracle compatible modes) for data subscription.
Note
Data subscription is an allowlist feature. If you need to use this feature, please contact technical support.
Procedure
Create a data subscription task.
Log in to the OceanBase Cloud console.
In the left-side navigation pane, select Data Services > Data Subscription.
On the Data Subscription page, click Create Subscription Task in the upper-right corner.
Enter a custom name for the subscription task in the Edit Task Name field.
We recommend that you use a combination of Chinese characters, digits, and letters. The name cannot contain spaces and must be no longer than 64 characters.
On the Configure Source page, configure the parameters.
If you want to reference an existing data source, click Quick Fill next to Source, select the target data source from the drop-down list, and then the configurations in the Source section will be automatically filled in. If you want to save the current configuration as a new data source, click the Save icon in the upper-right corner of the Source section.
You can also click Manage Data Sources in the Quick Fill drop-down list to go to the Data Sources page, where you can view and manage data sources. This page provides unified management of different types of data sources. For more information, see Data Sources.
Parameter Description Cloud Vendor Only Alibaba Cloud is supported. Region Select the region where the source database is located. Database Type Only OceanBase MySQL Compatible and OceanBase Oracle Compatible are supported. Instance Type Only Dedicated (Transactional) is supported. Instance Select the ID or name of the instance where the MySQL or Oracle compatible tenant of OceanBase Database is located from the drop-down list. Tenant Select the ID or name of the MySQL-compatible or Oracle-compatible tenant of OceanBase Database from the drop-down list. Account The username of the OceanBase Database user for data subscription. Password The password of the database user. Click Test and Continue.
On the Select Type & Objects page, in the Subscription Type section, select the type of data to be subscribed from the source database.
The subscription types are Data Changes and Schema Changes.
Data Changes: indicates that incremental data updates such as INSERT, DELETE, and UPDATE operations on the selected objects are to be subscribed.
Schema Changes: indicates that schema changes such as creation, modification, and deletion of the selected objects are to be subscribed.
On the Select Type & Objects page, in the Select Subscription Scope section, select the objects to be subscribed from the source database.
Data subscription supports Database Table Subscription and Whole Database Subscription. Table subscription allows you to select one or more tables from one or more databases as the subscription objects. Database subscription allows you to select an entire database as the subscription object. If you select table subscription for a database, you cannot select database subscription for that database. If you select database subscription for a database, you cannot select table subscription for that database.
After you select Database Table Subscription or Whole Database Subscription, select the subscription objects in the left-side navigation pane and click > to add them to the right-side list. You can remove one or more subscription objects from the right-side list.
Click Next. On the Subscription Options page, configure the parameters.
Parameter Description Data Format The message format of the subscribed data. The downstream consumer program must be compatible with the message format. Currently, Avro and Canal JSON are supported. For more information, see Message Format. Topic Partitioning Strategy The partitioning strategy. Valid values: No Partitioning, Partition by Table Name, and Partition by Primary Key. Select a value as needed. - No Partitioning: All data is written to partition 0.
- Partition by Table Name: Data with the same table name is written to the same partition based on the hash value of the table name.
- Partition by Primary Key: Data with the same primary key is written to the same partition based on the hash value of the primary key.
Topic Partitions The number of partitions. The more partitions, the more dispersed the data. The default value is 4, and the minimum value is 1. The maximum value is 256. Notice
This parameter is not displayed when the topic partitioning strategy is set to No Partitioning.
After the parameters are configured, click Precheck.
If you click Save on this page, you are redirected to the details page of the data subscription task. You can perform a precheck after the task is started.
If the precheck is successful, click Start.
If you do not want to start the data subscription task now, click Save to go to the details page of the data subscription task. You can start the task later as needed.
