MentorNode
Start free
Real-Time & CollaborationHarddesign-multiplayer-game-backend

Design a Real-Time Multiplayer Game Backend

Design the authoritative simulation for a competitive game: tick-rate state sync, lag compensation, cheat resistance, and matchmaking that fills lobbies fast and fairly.

Authoritative ServerState ReconciliationLockstep vs RollbackMatchmaking
Traffic & Capacity Estimates:

2M concurrent players · 60Hz tick rate · <60ms region RTT · 100k concurrent matches

Functional Requirements

  • •Run an authoritative simulation per match and broadcast state deltas to all participants at a fixed tick rate.
  • •Accept client inputs, validate them server-side, and reconcile client prediction with server truth.
  • •Match players into sessions by skill, latency, and queue time, and allocate a game server for each.
  • •Persist match results, ratings, and progression after the session ends.

Non-Functional Requirements

  • •End-to-end input-to-render latency under 100ms within a region.
  • •Clients must never be trusted for game-affecting state — the server is authoritative.
  • •A crashed match server must not corrupt player ratings or lose the match record.

Back-of-the-Envelope Math

  • 100k matches * 60 ticks/second = 6M state broadcasts/second, each fanned out to 10 players.
  • Delta compression plus interest management keeps per-player bandwidth near 100 Kbps instead of megabits.

Key Architectural Trade-offs

  • Client-side prediction with server reconciliation feels instant and produces rubber-banding; strict server-authoritative rendering is honest and feels laggy.
  • Deterministic lockstep (tiny bandwidth, one slow player stalls everyone) vs state synchronization with rollback (robust, far more bandwidth and server CPU).
  • Matchmaking quality against queue time: stricter skill bands make better matches and empty lobbies at off-peak hours.

Click or drag a component onto the canvas, then connect the handles to draw the data flow.

3 nodes · 2 edges

Components · 35

Client & Edge4
Compute & Gateway7
Storage & Caching11
Messaging & Streaming6
Coordination & Ops5
Intelligence2
Canvas overview