How Maoyan Unified Billions of App and Mini‑Program Accounts
This article details Maoyan's multi‑account integration journey, describing the background, challenges, industry research, and a three‑phase write‑through solution that merges APP and mini‑program accounts using phone numbers as a common anchor while ensuring data consistency, scalability, and minimal user impact.
1. Background
Maoyan, a leading online ticketing platform in China, has evolved through brand independence and mergers, resulting in separate APP and mini‑program account systems built on a SaaS architecture. This architecture isolates tenant data, causing the same natural person to have isolated accounts across channels, which initially helped differentiate products but later led to fragmented user data, brand confusion, and difficulty leveraging cross‑channel traffic.
1.2. Problem
The integration of accounts faces several challenges:
Seamlessly merge differentiated accounts with minimal user perception.
Support user actions such as re‑binding, deregistration, and carrier‑issued number changes.
Cater to diverse business scenarios (e.g., community info, viral sharing, e‑commerce identifiers).
Handle abnormal accounts during integration to prevent large‑scale issues.
Maintain consistency and reliability for billions of accounts.
Reduce business transformation costs with low‑intrusion methods.
1.3. Research
Industry solutions were surveyed and grouped into three categories: strengthening binding, weakening binding, and silent binding. Maoyan’s situation—APP and mini‑program with minimal functional differences and massive user bases—differs from many large‑scale platforms, so a custom approach was needed.
2. Maoyan Practice
2.1. Overall Integration Plan
2.1.1. Common Anchor
The integration uses a common anchor (a unique identifier across channels). Maoyan evaluated phone numbers and third‑party IDs (e.g., WeChat UnionId) and chose the phone number as the public anchor.
2.1.2. Write‑Through Integration
Instead of read‑through (display‑only binding), Maoyan adopted a write‑through approach that fully merges accounts and migrates user and asset data, despite higher technical challenges such as performance, availability, and data consistency.
2.1.3. Target Account
The APP account was selected as the target account because of stronger brand recognition and larger active user base.
2.2. Account Service Integration
The integration was executed in three steps:
Incremental account handling – dual‑write synchronization for new accounts.
Historical account migration – moving and cleaning existing data while ensuring consistency.
Decoupling legacy services – transitioning from two‑side registration to a full switch to the unified service.
2.2.1. Step 1: Incremental Handling – Dual Write
A unified gateway abstracts account operations, allowing simultaneous writes to both systems during registration and login, ensuring no data loss for new accounts.
2.2.2. Step 2: Historical Migration
Challenges included dispersed data sources, large‑scale synchronization time, and consistency risks. Maoyan addressed these with horizontal scaling, multi‑process/thread processing, TCP and JVM tuning, multi‑round synchronization with inspection and compensation, and failover mechanisms.
2.2.3. Step 3: Service Decoupling – Two‑Side Registration to Full Switch
During the transition, both the original mini‑program service and the new unified service generate separate IDs, with a mapping maintained internally. After stabilization, the mini‑program service is fully retired.
2.3. Global Asset Integration
Asset integration follows the account merge and consists of two phases:
Integration linking – embedding account merge logic into the C‑end registration/login flow.
Integration execution – scheduling global data merges during low‑traffic windows using an asynchronous, non‑blocking approach.
2.3.1. Integration Linking
The login process incorporates asset merge steps, with version fallback and compatibility handling.
2.3.2. Integration Execution
The merge resembles a Full GC pause: a controlled window blocks new writes to ensure complete and consistent data consolidation. Maoyan schedules merges at off‑peak times, records lock status per account, and releases locks after completion.
An integration scheduling center provides gray‑release, downgrade, observability, and failure‑tolerant capabilities, handling millions of daily calls with high availability. Performance is supported by asynchronous MQ, DB transactions with caching, Elasticsearch and Hive for large‑scale data, and PaaS isolation with rate limiting and horizontal scaling.
3. Summary
Based on industry research and Maoyan’s unique product context, a three‑step write‑through integration using phone numbers as the common anchor was designed and executed, successfully consolidating billions of accounts and laying the foundation for seamless global asset integration.
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.
