Design and Implementation of Ctrip's Data Replicate Center (DRC) for Database Cloud Migration
This article details Ctrip's Data Replicate Center (DRC) architecture, challenges, and solutions for migrating MySQL databases to the cloud, covering read‑only and read‑write scenarios, cost analysis, proxy modules, transaction‑table replication, data isolation, filtering, deployment workflow, and achieved performance and cost benefits.
Introduction: Under Ctrip's internationalization strategy, DRC is a standard solution for database cloud migration, supporting core services such as instant messaging, user accounts, and IBU.
Business cloud scenarios: Discusses when to cloud databases, distinguishing read‑only and read‑write overseas scenarios, and analyzes associated traffic and database costs.
DRC architecture challenges: Highlights cross‑internet replication issues, introduces a Proxy module with TLS encryption and BBR congestion control, and describes heartbeat detection, traffic control, and dual‑operator line redundancy.
Transaction‑table replication: To replace the unavailable set gtid_next on cloud RDS, DRC introduces a monitoring database with a transaction table that records GTID information. The DDL is: CREATE TABLE `drcmonitordb`.`gtid_executed` ( `id` int(11) NOT NULL, `server_uuid` char(36) NOT NULL, `gno` bigint(20) NOT NULL, `gtidset` longtext, PRIMARY KEY (`id`,`server_uuid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Data isolation and filtering: Describes table mapping and row‑filtering mechanisms (UID, Java regex, Aviator expressions) to achieve domestic‑overseas data segregation without extensive application changes.
Deployment process: Outlines a four‑step migration workflow—database clouding, application clouding, traffic gray‑release, and final traffic split—along with DAL cluster configuration for near‑by access, traffic splitting based on UID, conflict resolution via timestamps, and automatic handling of schema changes.
Results and future plans: Since November 2021, over 90 DRC replication clusters have been deployed, achieving average latencies of 90 ms (Shanghai‑Singapore) and 260 ms (Shanghai‑Frankfurt), reducing MySQL cluster count to 1/5 and replication cost to 2/5; future work includes supporting message delivery, full‑data copy, and shared storage for Replicator.
Ctrip Technology
Official Ctrip Technology account, sharing and discussing growth.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.