Inside Alibaba’s City‑Level Active‑Active Architecture: A Complete Guide
The article explains Alibaba’s city‑level active‑active architecture, where two independent data centers in the same city simultaneously serve traffic, automatically fail over on outage, and are organized into traffic, application, and data layers with detailed design patterns.
City Active‑Active Overview
City active‑active deploys two independent data centers within the same city, each running a full set of services that are simultaneously active and receive traffic. When either data center fails, traffic is automatically switched to the other, providing uninterrupted service.
Architecture Layers
Traffic Layer
The traffic entry layer uses a global load balancer to distribute user requests to data center A or B based on IP geolocation or round‑robin algorithms. An application gateway at each data‑center entrance parses a route key (e.g., user_id) and determines the target cell. If a request lands in the wrong data center—such as an odd user_id that should be handled by A but arrives at B due to DNS drift—the gateway performs an internal cross‑data‑center redirect to the correct location.
Application Layer
Services are designed to be stateless. Typical practices include:
Stateless Web/API services
Centralized session storage
Unified task‑scheduling center
Data Layer
The data layer is the key to a successful active‑active deployment. Common patterns are:
Master‑slave replication with automatic failover (a basic one‑master‑one‑slave setup, not true active‑active)
Dual‑master architecture where both centers can write, requiring conflict resolution and strong consistency mechanisms
Sharding by business domain or user segment, placing different business lines or user groups in separate centers to reduce cross‑center write conflicts
Typical request flow:
User request
│
┌────────┴────────┐
│ │
│ IDC‑A IDC‑B
│ (Active) (Active)
│ │
│ Application Cluster
│ Application Cluster
│ │
│ Redis Cluster Redis Cluster
│ MySQL Cluster MySQL Cluster
│ │
│ │ │
│ │ │
│ └────────────┘By separating responsibilities across the traffic, application, and data layers and applying the appropriate data‑layer pattern, continuous availability and seamless failover are achieved for services running in the same city.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Mike Chen Rui
Over 10 years as a senior tech expert at top-tier companies, seasoned interview officer, currently at leading firms like Alibaba.
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.
