Design an online chess platform.
Requirements:
-
User matchmaking (ranked/unranked).
-
Real-time gameplay with low latency moves.
-
Enforce game rules and clocks (timers).
-
Persist game history and allow reconnection.
-
Scale: serve a user base the size of a large social network, with a very large number of games in progress at once. The real-time, two-way connection layer between clients and servers must hold millions of concurrent connections.
Out of scope: advanced cheat detection, analysis engine.
Variant: the platform may instead run inside a large social app. A player challenges a friend from within the app and the friend accepts. The host app already provides accounts, the friend graph and push notifications, so design the chess service and how it plugs into them rather than rebuilding them.