System Design Atlas

Real-time multiplayer world

06 / 10Worked example

The overall architecture

Which data belongs in the volatile simulation and which in the durable reward datastore?

This runtime topology follows from the data contract: game client ↔ session router ↔ authoritative game process; game process → reward datastore and checkpoints. State snapshots flow directly from the game process to clients. The session router queries the authentication service for join authorisation. The restart coordinator assigns a higher authority generation and starts the game process from a checkpoint plus durable reward records. Internal modules are domain code boundaries; a separate process has its own operational lifecycle.

Starting point Bind every durable record to the current authority generation.

Assumptions for the example case

A fictional example design: one session with at most 32 players, server-authoritative movement, one-time pickup of world items, reconnection within the same session and durably confirmed rewards. Figures and quality goals are illustrative test assumptions. A shared global game world, player trading, paid items and comprehensive fraud detection are outside the scope.

Runtime architecture

Runtime Architecture · Authority per session and generation

Game clientInputs + smoothing

Platform

SitzungsrouterAllocation
SpielprozessAuthoritative simulation
BelohnungsspeicherDurable records
CheckpointsWorld state
WiederanlaufkoordinatorHigher generation
Authentication serviceIdentity verification
Game client → Session routerJoin + inputs
Session router → Game clientAllocation
Session router → Game processGeneration + Session
Game process → Game clientState snapshots
Game process → Reward storeWinning record
Game process → CheckpointsWorld state
Session router → Authentication serviceCheck join authorisation
Restart coordinator → Game processHigher generation
Checkpoints → Restart coordinatorCheckpoint
Reward store → Restart coordinatorDurable records

The game process simulates the world; the reward datastore and checkpoints provide different durability guarantees.

State snapshots are frequent; rewards are rare. Scale the game process and durable reward datastore separately. The snapshot path avoids unnecessary journal access.

Domain modules within the application

Inside the game process · Tick path without network lanes

Input orderingGeneration + sequence
Simulation20 ticks/s
Item allocationDistance + one-time ownership
State outputReplaceable snapshots
ReconnectionIdentity + records

Input ordering validates generation and sequence; item allocation records the result using the simulated distance.

Input ordering checks session, generation and input sequence. Simulation calculates positions at 20 ticks/s. Item allocation decides one-time pickups from server-side distance. State output creates replaceable snapshots for visible characters. Reconnection links identity, current generation and existing records.

Operational boundaries

Runtime
Game client ↔ session router ↔ authoritative game process; game process → reward datastore and checkpoints. State snapshots flow directly from the game process to clients. The session router queries the authentication service for join authorisation. The restart coordinator assigns a higher authority generation and starts the game process from a checkpoint plus durable reward records.
Persistence
Transactional datastore for game session W-21, player characters P-21 and P-22, and crystal G-21. Authoritative changes and retry results are stored together; external effects require their own evidence.

Run simulation separately

Run simulation separately

Scale the game process and durable reward store separately.

State snapshots are frequent; rewards are rare.

The state snapshot data path avoids unnecessary journal access.

Alternative considered
A synchronous web request for every snapshot ties snapshot rate to datastore latency.
Trade-off
Operations must monitor two process lifecycles.
Reassess
A few very small sessions justify a simpler deployment.

Terms in this step

Run simulation separately
The state snapshot data path avoids unnecessary journal access.

Try it yourself

Assign simulation, state output and reward records to their process and storage boundaries.

A hint for your attempt

Use the specific entities and conditions from this step. The two solution parts distinguish the decision from its evidenced outcome.

Compare with a possible solution
First part of the solution
Simulation and state output belong to the authoritative game process. Snapshots flow to clients and are replaceable.
Second part of the solution
The reward record lives durably in the reward datastore. It must exist before final ownership confirmation and is read on restart.

Apply to your project

Which corresponding assumption would you test first in your project? Consider this trigger: A few very small sessions justify a simpler deployment.

Step 7 examines confirmation that survives a crash.