How UCS Powers Global Traffic Scheduling and Compliance
This article explains how Ctrip’s Universal Control Service (UCS) handles global traffic routing, data‑compliance zones, region failover, and gradual migration by using configurable strategy models, partitioning logic, and a lightweight degradation mask to ensure reliable, compliant user experiences worldwide.
Introduction
Universal Control Service (UCS) is the central component for global traffic scheduling in a worldwide architecture. It decides the target Region for each request based on the user’s data location (UDL), session identifiers and the health status of Regions.
User‑traffic compliance scheduling
UCS guarantees that user data is processed inside the compliance zone (region) required by law. It distinguishes two request categories:
Logged‑in requests : the user account provides a UDL, allowing direct routing to the compliant Region.
Anonymous requests :
Stateless scenarios (e.g., product browsing) use nearest‑node routing for latency.
Stateful flows use a session ID to achieve sticky routing to a single Region during the session.
UCS also supports region‑level operations:
Region failure – rapid diversion of traffic away from a failed Region.
Compliance‑zone adjustment – migration of data when legal requirements change.
Business expansion – addition of new Regions and traffic migration.
Scheduling model
The service maintains a mapping between compliance zones and their constituent Regions. A basic UDL strategy routes users based on their UDL and a hash‑based partition of the user ID (UID). The model consists of three parts: input (parameters consumed), output (target Region), and routes (matching conditions and partition rules).
{
"input": ["udl", "uid"],
"output": ["region"],
"routes": [
{
"key": "udl",
"values": ["UDL_A", "UDL_B"],
"partition": [{"key": "uid", "range": "0-99", "output": ["REGION_A"]}]
},
{
"key": "udl",
"values": ["UDL_C", "UDL_D"],
"partition": [{"key": "uid", "range": "0-99", "output": ["REGION_B"]}]
}
]
}Each route defines a key (e.g., "udl"), a set of values that trigger the route, and a partition that uses the UID hash to select a Region within a defined range.
Gradual migration example
When a new Region (REGION_C) is added to ComplianceArea_1 , traffic for UDL_A can be shifted gradually by adjusting the partition ranges:
{
"input": ["udl", "uid"],
"output": ["region"],
"routes": [
{
"key": "udl",
"values": ["UDL_A"],
"partition": [
{"key": "uid", "range": "0-89", "output": ["REGION_A"]},
{"key": "uid", "range": "90-99", "output": ["REGION_C"]}
]
},
{
"key": "udl",
"values": ["UDL_B"],
"partition": [{"key": "uid", "range": "0-99", "output": ["REGION_A"]}]
},
{
"key": "udl",
"values": ["UDL_C", "UDL_D"],
"partition": [{"key": "uid", "range": "0-99", "output": ["REGION_B"]}]
}
]
}By continuously adjusting the percentage ranges, traffic is shifted until all UDL_A requests are served by REGION_C.
UCS system architecture
The architecture consists of three main components:
UCS Console : a management UI and OpenAPI for policy updates, releases and failure‑scenario planning.
Configuration Center : pushes policy configurations to clients in real time.
UCS Client : embedded in services to perform local caching, routing calculation and change notifications.
Key client capabilities:
Local cache of policies for fast lookup.
API for routing computation based on input parameters.
Subscription mechanism to receive policy‑change events, enabling dependent components (e.g., message queues) to adjust processing.
Region‑level degradation mask
During a Region‑wide outage, UCS can apply a lightweight degradation mask that maps the failing Region to alternative targets with assigned weights. The mask is much smaller than full strategy files, reducing pressure on the Configuration Center while preserving original routing logic.
{
"source": "REGION_A",
"targets": [
{"region": "REGION_C", "weight": 50},
{"region": "REGION_D", "weight": 50}
]
}Conclusion
UCS provides a flexible, compliance‑aware global traffic‑scheduling framework. By separating strategy definition, partition logic and degradation handling, it enables seamless Region failover, gradual migrations and consistent user experiences across continents.
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.
