Databases 15 min read

Database Independence Migration for Yanxuan Trading System: Architecture Evolution and Implementation

Yanxuan migrated its monolithic trading system from a shared DDB cluster to an independent database by using Netease Data Canal for real‑time sync, a write‑stop switch with Pandora middleware, account and permission isolation, and extensive testing across three phases to ensure data consistency and minimal business impact.

NetEase Yanxuan Technology Product Team
NetEase Yanxuan Technology Product Team
NetEase Yanxuan Technology Product Team
Database Independence Migration for Yanxuan Trading System: Architecture Evolution and Implementation

This article details the database independence migration process for Yanxuan's trading system, addressing the challenges of transitioning from a shared database architecture to an independent trading database. The trading system initially used a monolithic architecture with shared DDB clusters, but as business complexity grew, service decomposition began, though database resource sharing persisted.

The core challenges included ensuring data consistency (no data loss, no dirty data) and smooth migration (seamless source switching, minimal business impact). The solution employed NDC (Netease Data Canal) for real-time data synchronization between source and target databases, supporting both full migration and incremental synchronization with DDB compatibility.

For business switching, a write-stop approach was chosen over alternatives like non-stop write or dual-write, considering traffic patterns and cost factors. Data source dynamic switching was implemented using Yanxuan's self-developed Pandora middleware, which supports dynamic configuration without restart and provides data difference comparison capabilities.

Account precision control was achieved through account isolation (copying yanxuan to yanxuan_new) and permission isolation (excluding trading tables from yanxuan, restricting yanxuan_new to trading tables only). Business monitoring combined APM table queries with AOP interception to ensure complete write operation coverage. Code change analysis SDK was used for precise testing to identify affected interfaces.

Essential preparatory work included data source dynamic switching transformation, transaction-aware data source switching in Spring+MyBatis environments, and big data platform switching with binlog Kafka topic configuration. The independence process was orchestrated in three phases: migration, rollback, and completion, with extensive testing and validation rehearsals conducted before production deployment.

The article provides comprehensive insights into database independence migration strategies, implementation details, and lessons learned for similar enterprise database migration projects.

System Architecturedata consistencyDatabase Migrationreal-time synchronizationtransaction managementbig data integrationdynamic data source switchingEnterprise Database
NetEase Yanxuan Technology Product Team
Written by

NetEase Yanxuan Technology Product Team

The NetEase Yanxuan Technology Product Team shares practical tech insights for the e‑commerce ecosystem. This official channel periodically publishes technical articles, team events, recruitment information, and more.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.