Design a scalable game matchmaking and waiting-queue system
Context
You are designing the matchmaking system for a large real-time multiplayer game. Players join a waiting queue and are matched into games under constraints such as team size, region, and skill level.
Tasks
-
Overall architecture: components, data flow, and interactions from Join Queue to Game Start.
-
Data model: entities, required fields, indexes, and storage choices.
-
Matchmaking algorithm: queueing model, candidate selection, scoring, and formation of matches.
-
Fairness and low wait times: policies and mechanisms to balance match quality vs. latency.
-
Timeouts, cancellations, retries: ready-check flow, heartbeats, and requeue logic.
-
Constraints: team size, region and latency, skill level, parties; how they are enforced and relaxed.
-
High concurrency: sharding strategy, worker assignment, and hot-spot mitigation.
-
Reliability: idempotency, failure recovery, backpressure, and observability.
Assume a global player base with multiple regions, multiple game modes (e.g., 1v1, 3v3, 5v5), and peak spikes. Target low wait times and high match quality.