首页 Configure a real-time synchronization task (legacy)

Configure a real-time synchronization task (legacy)

更新时间: 2026-05-29 06:23:35

After you configure the necessary data sources, network connectivity, and resources, you can create a real-time synchronization task. These tasks combine various source and destination data sources into a pipeline for the real-time incremental synchronization of a single table or an entire database. This topic describes how to create such a task and monitor its running status.

Prerequisites

  • Configure the required data sources. You must configure the source and destination databases before you configure a Data Integration synchronization task. This lets you specify the databases for reading and writing data by selecting the data source name during task configuration. For more information about the data sources supported by real-time synchronization and their configurations, see Supported data sources and synchronization solutions.

  • You have purchased a resource group with appropriate specifications and associated it with the workspace. For more information, see Use a Serverless resource group.

  • Network connectivity is established between the resource group and the data sources. For more information, see Configure network connectivity.

Limitations

This version of real-time synchronization is supported only in Data Studio (legacy).

Go to Data Studio

Note

Single-table real-time synchronization tasks for some channels must be created in Data Studio. For details on channel support, see Supported data sources.

Log on to the DataWorks console. After switching to the target region, in the left-side navigation pane, choose Data Development and O&M > Data Studio. Select the desired workspace from the drop-down list and click Go to Data Studio.

Step 1: Create a real-time synchronization task

  1. Create a workflow. For more information, see Create a workflow.

  2. Create a real-time synchronization task. You can create the task by using either of the following methods.

    • Method 1: Expand the workflow, right-click Data Integration > Create Node > Real-time Synchronization.

      Method 2: Double-click the workflow name, click Create Node, and then drag the Real-time Synchronization node from the Data Integration directory to the workflow editing panel on the right.实时同步

  3. In the Create Node dialog box, configure the parameters.

Parameter

Description

Node type

The default value is Real-time Synchronization.

Synchronization Method

  • For single-table incremental data, select Single Table (Topic) to Single Table (Topic) ETL to replicate data from one or more source tables to a single destination table in real time.

    Note

    Single-table real-time synchronization supports writing data to only one destination table per task. If you need to synchronize data to multiple tables, use the following solutions:

    • If you need to apply data filtering, string replacement, or data masking during synchronization, you can create multiple single-table real-time synchronization tasks.

    • To perform a full synchronization followed by real-time incremental synchronization to the destination, use a whole-database real-time synchronization task in Data Integration. For more information, see Configure a whole-database real-time synchronization task.

  • To synchronize incremental data for an entire database in real time, select a sync method such as Synchronization of Data Changes from Database to MaxCompute. The specific name varies depending on the destination data source.

Path

The directory where the real-time synchronization task is stored.

Name

The node name can contain uppercase and lowercase letters, Chinese characters, digits, underscores (_), and periods (.). The name cannot exceed 128 characters.

Step 2: Configure a resource group

Real-time synchronization tasks require either a Serverless resource group or an exclusive resource group for Data Integration. On the task configuration page, click Basic Configurations in the right-side navigation pane. In the Resource Group drop-down list, select a resource group that has network connectivity to your database.

Note
  • If a resource group that you created is not displayed, make sure that the resource group is associated with the workspace. For more information, see Use a Serverless resource group.

  • We recommend that you run real-time and offline synchronization tasks on different resource groups. This prevents resource contention between workloads. For example, contention for CPU, memory, or network resources can slow down offline tasks, introduce latency to real-time tasks, or even cause tasks to be terminated by the Out of Memory (OOM) killer in extreme cases of resource scarcity.

  • A Serverless resource group allows you to specify an upper limit for the CUs that a synchronization task can use. If your synchronization task encounters an OOM error due to insufficient resources, increase the CU allocation for the resource group.

Step 3: Configure the real-time synchronization task

Configure a single-table real-time synchronization task

  1. Configure the input data source.

    The following input data sources and their configurations are supported for single-table data synchronization:

    1. In the Input section on the left side of the real-time synchronization task configuration page, drag the target input data source component to the panel on the right.

      PixPin_2025-11-05_16-57-22

    2. Click the input component and configure its parameters in the Node Configuration panel on the right.

  2. Optional: Configure data transformations.

    To transform input data into the required output format during real-time synchronization, configure data transformations.

    The following data transformations are supported for single-table data synchronization:

    • Configure data filtering: You can filter data based on rules, such as the size of a field. The task retains only data that meets the rules.

    • Configure string replacement: You can replace values in string-type fields.

    • Configure data masking: You can mask sensitive data from a single table during real-time synchronization and then store it in a specified database location.

    1. In the Conversion area on the left side of the real-time synchronization task configuration page, drag the desired data transformation component to the panel on the right. Hover over the upstream component to display its connection points. Connect the bottom point of the upstream component to the top point of the transformation component. After the components are connected, you can configure the transformation component in the Node Configuration panel.

      PixPin_2025-11-05_16-59-38

    2. Click the transformation component and configure its parameters in the Node Configuration panel on the right.

  3. Configure the output data source.

    The following output data sources and their configurations are supported for single-table data synchronization:

    1. In the Output area on the left side of the task configuration page, drag the target output data source component to the panel on the right and connect it to the upstream component. Configure the destination data source, table, and field mappings. If the destination table does not exist, you can click Create Table to quickly create one.

      PixPin_2025-11-05_17-09-10

    2. Click the output component and configure its parameters in the Node Configuration panel on the right.

  4. In the toolbar at the top of the canvas, click Save to complete the task configuration.

Configure a whole-database real-time synchronization task

Note

DataWorks recommends using whole-database real-time synchronization tasks in Data Integration.

  1. Set the synchronization source and rules.

    1. In the Data Source area, select the Value and Data Source name of the data source that you want to synchronize.

    2. Select the tables to synchronize.

      The Select Source Table for Synchronization area displays all tables in the selected data source. In the Source Databases/Tables area, select the entire database or specific tables to synchronize, and click the 图标 icon to move them to the Selected Databases/Tables list.

      Important

      Tables without a primary key cannot be synchronized in real time.

    3. Set the mapping rules for table names.

      In this step, you can select the databases and tables from the source data source to synchronize. By default, the solution writes the source databases and data tables to a destination schema or table with the same name. If the destination schema or table does not exist, the system automatically creates it. You can also use Mapping Rules for Table Names to define the final schema or table names at the destination. This allows you to write data from multiple tables into a single table, or to uniformly update the prefix of source database or table names when writing to the destination.

      • Source and destination table name conversion rules: You can use regular expressions to convert source table names into the final destination table names.

        • Example 1: Write data from source tables with the doc_ prefix to destination tables with the pre_ prefix.改名

        • Example 2: Write data from multiple tables into a single destination table.

          Synchronize data from source tables named "table_01", "table_02", and "table_03" to a single table named "my_table". Configure the regular expression for table name conversion as follows: Source: table.*, Destination: my_table.示例

      • Rule for Destination Table Name: You can use a combination of built-in variables to generate destination table names. You can also add prefixes and suffixes to the converted destination table names. The available built-in variables are:

        • ${db_table_name_src_transed}: The table name after the conversion specified in "Source and destination table name conversion rules".

        • ${db_name_src_transed}: The destination schema name after the conversion specified in "Source and destination schema name conversion rules".

        • ${ds_name_src}: The name of the source data source.

        Example: To further process the table name converted in the previous step, use ${db_table_name_src_transed} to represent the result "my_table". You can then add a prefix and suffix to this variable, for example, pre_${db_table_name_src_transed}_post, which maps to the destination table named "pre_my_table_post".

      • Source and destination schema name conversion rules: You can use regular expressions to convert source schema names into the final destination schema names.

        Example: Replace the source database name prefix doc_ with pre_.schema

  2. Select the destination data source and configure the destination table or topic.

    1. On the Configure Destination Table or Topic page, configure the basic information for the Destination Data Source data source, such as the write mode and partition settings. The specific configuration varies depending on the data source.

    2. Click Refresh Source and Destination Table Mapping to create the mapping between the source and destination tables.

      Use Edit additional fields to customize the destination schema, table name, and add constants or variables to the destination table. The specific configuration varies depending on the data source.

      Note

      Synchronizing a large number of tables can be slow.

  3. Optional: Set table-level synchronization rules.

    This lets you define a processing strategy for insert, update, or delete operations that occur in the source table.

    Note

    The availability of DML processing policies depends on the specific synchronization solution. For the current DML support status of data sources, see Supported DML and DDL operations.

  4. Set DDL message processing rules.

    Source data sources can involve many DDL operations. During real-time synchronization, you can set processing policies for different DDL messages based on your business needs. Supported DDL operations may vary by data source. For more information, see Supported DML and DDL operations. You can set DDL processing policies for each destination database type on the Data Integration > Configuration Options > Processing Policy for DDL Messages in Real-time Sync page. The following table describes the DDL message processing policies.

    DDL message type

    Processing policy

    Create Table

    When DataWorks receives a DDL message of the corresponding type, the processing policy is as follows:

    • Normal: Forwards the message to the destination data source for processing. DataWorks only forwards the message; the actual handling depends on the destination data source.

    • Ignored Object: Discards the message without sending it to the destination data source.

    • Alert: Discards the message and records an alert in the real-time synchronization log, indicating that an execution error occurred.

    • Error: The real-time synchronization task immediately enters an error state and stops running.

    Delete Table

    Insert Column

    Delete Column

    Rename Table

    Rename column

    Modify Column Type

    Clear Table

  5. Configure runtime resources.

    • You can control the task's concurrency, which is the maximum number of threads that Data Integration uses to read from and write to databases.

    • You can control whether the synchronization task tolerates dirty data.

      • If dirty data is not allowed, the task fails if it encounters any dirty data.

      • If dirty data is allowed, the synchronization task ignores the dirty data (without writing it to the destination) and continues to run.

  6. Click Complete.

Step 4: Submit and deploy the task

  1. Click the 提交 icon in the toolbar to submit the node.

  2. In the Submit New Version dialog box, enter a Change Description.

  3. Click Confirm.

    If you are using a workspace in standard mode, you must deploy the task to the production environment after you submit it. Click Deploy Center on the left side of the top menu bar. For more information, see Deploy tasks.

Step 5: Run the task

Note

Real-time synchronization tasks cannot be run directly in Data Studio. You must deploy the task to Operation Center to start it and view its status.

After the task is configured, you can start and manage it on the Operation Center > Real-time Task O&M > Real-time Synchronization Task panel. For more information, see O&M for real-time synchronization tasks.

Next steps

After the task starts, you can click the task name to view its running details and perform task O&M and tuning.

FAQ

For common questions about real-time synchronization tasks, see FAQ for real-time synchronization.

Appendix: Task migration

For a single-table real-time integration task that is configured in Data Studio, click Migrate to Data Integration to migrate the task to the Data Integration page.

Note

Currently, only the following real-time integration tasks support migration:

  • Kafka-to-MaxCompute single-table real-time integration tasks.

  • Kafka-to-Hologres single-table real-time integration tasks.

  1. Double-click the single-table real-time integration task that you want to migrate to open its configuration page, and click Migrate to Data Integration to migrate the task.

    image

  2. In the upper-left corner, click image and select All Products > Data Integration. On the Synchronization Task page, you can find the successfully migrated single-table real-time integration task in the task list.image

Note
  • After migration, you can manage the task directly in Data Integration without switching to Operation Center. The migration does not affect saved task configurations or running tasks.

  • After migration, the system moves the original task to the Data Studio Recycle Bin. All subsequent editing and maintenance must be performed on the task list page in Data Integration.

阿里云首页 大数据开发治理平台 DataWorks 相关技术圈