AnalyticDB for MySQL provides a zero-ETL feature that allows you to create a RDS for MySQL from AnalyticDB for MySQL to AnalyticDB for MySQL. This feature helps you manage data synchronization from a single console to integrate transaction processing with data analytics.
Overview
In the era of big data, businesses often manage data that is scattered across different systems and platforms. To use this data effectively, they typically rely on extract, transform, and load (ETL) tools for centralized data management.
ETL is a process that extracts data from upstream business systems, transforms and cleanses it, and then loads it into a data warehouse. The goal is to consolidate distributed data into a target data warehouse for further analysis, enabling better business decisions.
Traditional ETL processes often have the following drawbacks:
-
Increased resource costs: Different data sources may require different ETL tools. Building ETL data pipelines incurs additional resource costs.
-
Increased system complexity: You must maintain the ETL tools yourself, which increases operational complexity and diverts focus from application development.
-
Data latency: Some ETL processes involve periodic batch updates. In near real-time applications, this can delay the generation of analytical results.
To address these challenges, Alibaba Cloud provides the zero-ETL feature. It allows you to quickly build a data synchronization task between an online transaction processing (OLTP) system and an online analytical processing (OLAP) system. This feature automatically extracts, transforms, and loads data from the OLTP system to the data warehouse. This streamlines data management, integrates transaction processing with analytics, and lets you focus on core data analysis.
Benefits
-
Easy to use: You do not need to create and maintain complex data pipelines for ETL. To create a real-time data synchronization task, simply select the source and destination. This frees you to focus on application development.
-
Zero cost: Zero-ETL links do not incur additional charges. You can analyze upstream data in AnalyticDB for MySQL for free.
-
Multi-source aggregation: Use zero-ETL tasks to synchronize data from multiple instances to a single AnalyticDB for MySQL cluster in real time, creating a unified view for global analysis.
Supported synchronization
-
Data synchronization from RDS for MySQL to AnalyticDB for MySQL.
-
Data synchronization from PolarDB for MySQL to AnalyticDB for MySQL. For more information, see Synchronize data from PolarDB for MySQL.
Prerequisites
-
Your AnalyticDB for MySQL cluster and RDS for MySQL instance must be in the same region.
-
You must have database accounts for the AnalyticDB for MySQL cluster and the RDS for MySQL instance.
Billing
Zero-ETL tasks are free of charge.
Usage notes
-
The zero-ETL feature is available only in the following regions: China (Beijing), China (Hangzhou), China (Shanghai), China (Shenzhen), China (Zhangjiakou), China (Qingdao), China (Guangzhou), China (Hong Kong), Singapore, US (Silicon Valley), and US (Virginia).
-
If the number of zero-ETL tasks in your AnalyticDB for MySQL cluster reaches the limit, you cannot create new tasks. You can use DTS to create new data synchronization tasks or delete unused zero-ETL tasks to free up capacity. The limits are as follows:
-
If the total reserved ACUs of the cluster is less than 24, you can create one zero-ETL task.
-
If the total reserved ACUs of the cluster is 24 or more, you can create
3 + 3 * floor((Total ACUs - 24) / 50)zero-ETL tasks.The result of
floor((Total ACUs - 24) / 50)is rounded down to the nearest integer. For example, if a cluster has 48 ACUs, the calculation is3 + 3 * floor((48 - 24) / 50), which is3 + 3 * floor(0.48). This simplifies to3 + 3 * 0, allowing you to create 3 zero-ETL tasks.
Note-
For a Data Lakehouse Edition cluster, the total reserved ACUs is the sum of reserved computing ACUs and reserved storage ACUs.
-
For a Data Warehouse Edition cluster, one core equals one ACU. For a cluster in elastic mode, the total reserved ACUs is the sum of the cores for computing resources and elastic I/O resources. For a cluster in reserved mode, the total reserved ACUs is the number of cores for computing resources.
-
Preparations
Create a AnalyticDB for MySQL
-
Navigate to the Role page in the RAM console.
-
Check if a service-linked role named AliyunServiceRoleForAnalyticDBForMySQL already exists. If not, you must create the role.
-
In the left-side navigation pane, click Create Role.
-
In the Create Role dialog box, select Alibaba Cloud Service and click Next.
-
For the role type, select Service-Linked Role, and then select AnalyticDB for MySQL from the service drop-down list.
-
Click Finish. Return to the role list and verify that the service-linked role has been created.
Grant permissions to a RAM user
A RAM user needs the following two types of permissions to create and manage zero-ETL tasks.
Grant AnalyticDB for MySQL permissions
A RAM user must have the management permission for AnalyticDB for MySQL, AliyunADBFullAccess, to create and manage Zero-ETL links for AnalyticDB for MySQL. For instructions, see Manage RAM user permissions.
Grant zero-ETL permissions
A RAM user must have the permissions to create links for the source and destination instances (AnalyticDB for MySQL) to create and manage Zero-ETL links. You can create a custom permission policy that allows a RAM user to create links for all instances or only for specified instances of the data source and AnalyticDB for MySQL, and then attach the custom permission policy to the RAM user.
The following are example scripts for custom permission policies:
Authorize all RDS for MySQL instances and AnalyticDB for MySQL clusters
{
"Version": "1",
"Statement": [
{
"Effect": "Allow",
"Action": "dts:*",
"Resource": [
"acs:adb:*:*:*",
"acs:rds:*:*:*",
]
},
{
"Effect": "Allow",
"Action": [
"dts:DescribeRegions",
"dts:DescribeConfigRelations",
"dts:DescribeSrcLinkConfig",
"dts:DescribeDestLinkConfig",
"dts:DescribeLinkConfig"
],
"Resource": [
"acs:dts:*:*:*"
]
}
]
}
Grant permissions to a specified RDS for MySQL instance and AnalyticDB for MySQL cluster
{
"Version": "1",
"Statement": [
{
"Effect": "Allow",
"Action": "dts:*",
"Resource": [
"acs:adb:*:*:dbcluster/am-2zeod8ax4b9a****",
"acs:rds:*:*:dbinstance/rm-2ze6fs8ouh43****",
]
},
{
"Effect": "Allow",
"Action": [
"dts:DescribeRegions",
"dts:DescribeConfigRelations",
"dts:DescribeSrcLinkConfig",
"dts:DescribeDestLinkConfig",
"dts:DescribeLinkConfig"
],
"Resource": "acs:dts:*:*:*"
}
]
}
Procedure
-
Log on to the AnalyticDB for MySQL console. In the upper-left corner of the console, select a region. In the left-side navigation pane, click Clusters. Find the cluster that you want to manage and click the cluster ID.
-
Navigate to the zero-ETL feature page. The entry point varies based on the cluster edition.
-
For an Enterprise Edition, Basic Edition, or Data Lakehouse Edition cluster: In the left-side navigation pane, choose .
-
For a Data Warehouse Edition cluster: In the left-side navigation pane, choose .
-
-
Click Create Zero-ETL Task. On the Create Zero-ETL Task page, configure the source and destination database information.
-
Configure the source database information:
Source database
Description
Task Name
The name of the zero-ETL task.
Database Type
Select RDS for MySQL.
Access Method
Only Alibaba Cloud Instance is supported.
Instance Region
The region where the RDS for MySQL instance is located.
RDS Instance ID
The ID of the RDS for MySQL instance.
Database Account
The database account for the RDS for MySQL instance.
Database Password
The password for the database account of the RDS for MySQL instance.
Encryption
The method to connect to the RDS for MySQL instance. Options include non-encrypted connection and SSL secure connection.
NoteIf you select SSL-encrypted, you must first enable SSL encryption for the RDS for MySQL instance. For more information, see Use a cloud certificate to quickly enable SSL encryption.
-
Configure the destination database information:
Destination database
Description
Database Type
Currently, only AnalyticDB for MySQL 3.0 is supported as the destination.
Access Method
Only Alibaba Cloud Instance is supported.
Instance Region
The region where the AnalyticDB for MySQL cluster is located.
Instance ID
The cluster ID of the AnalyticDB for MySQL cluster.
Database Account
The database account for the AnalyticDB for MySQL cluster.
Database Password
The password for the database account of the AnalyticDB for MySQL cluster.
-
-
After you configure the parameters, click Test Connectivity and Proceed. On the configuration page, set the following parameters:
Parameter
Description
DDL and DML Operations to Be Synchronized
Select the DML and DDL operations to synchronize. All operations are selected by default.
Source Objects and Selected Objects
The source objects in the database and the objects to be synchronized.
Advanced Settings (Optional)
Configure retry intervals for database unavailability and other potential issues.
-
After you complete the settings, click Next: Configure Database and Table Fields and configure the following information:
Configuration
Description
Database Name
Select an existing database.
Table Name
Select an existing table.
Primary Key Column
The primary key column of the selected table.
Distribution Key
The distribution key column of the selected table.
Type
The table type. Options include partitioned table and replicated table.
Definition Status
After the database and table fields are configured, the status changes from Undefined to Defined.
-
After configuring all parameters, click Next: Save Task Settings and Precheck.
-
If the precheck is successful, click Start to launch the zero-ETL task.
On the Zero-ETL page, you can view information about the task, including its ID/Name, Source/Destination, and Status.
Zero-ETL monitoring and alerting
After you create and start a zero-ETL task, you can set alert rules in the CloudMonitor console to monitor its status in real time. Follow these steps:
-
Log on to the Cloud Monitor console.
-
View monitoring information.
-
In the left-side navigation pane, choose .
-
Hover over the AnalyticDB for MySQL card and click AnalyticDB for mysql 3.0 - ZeroETL Latency.
-
Click a cluster ID to view the monitoring information for the zero-ETL tasks in that cluster.
-
-
Create an alert rule.
-
In the left-side navigation pane, click .
-
Click Create Alert Rule. In the Create Alert Rule panel, configure an alert rule for the zero-ETL task. For more information, see Create an alert rule.
NoteFor the Product parameter, select AnalyticDB for mysql 3.0 - ZeroETL Latency.
-
-
Create a subscription policy.
-
In the left-side navigation pane, click .
-
Click Create a subscription policy. On the Create a subscription policy page, configure the subscription policy for the zero-ETL task. For more information, see Create an event subscription.
Note-
Product: Select Analyticdb for mysql 3.0.
-
event types: Select Abnormal or Restore.
-
Event Name: Select zero_etl_job_abnormal or zero_etl_job_restore.
-
-