Designing a game server means deciding, before you write much code, what the server is allowed to decide, how often players' views must agree, and what happens when a machine dies. The core answer: pick an authority model first (trusted server, client-authoritative with server reconciliation, or a hybrid), then choose a simulation tick and network model that fit your genre's timing tolerance, then design state ownership and persistence around those choices. Everything else — matchmaking, scaling, anti-cheat — follows from those three decisions. Get them wrong and no amount of infrastructure tuning saves you; get them right and a modest stack can carry a surprisingly large player base.

The hard part isn't picking a database or a cloud. It's that every genre pressures the design differently: a turn-based card game can tolerate a full second of latency, while a competitive shooter treats 30 ms as a budget to spend carefully. This guide walks through the ordered decisions, the trade-offs at each step, and the failure modes that show up in production.

Start with authority: who decides what is true?

Before topology, decide where truth lives. Three models cover most games.

Server-authoritative. The server runs the simulation and is the only source of truth. Clients send inputs, receive state, and render what they're told. This is the default for competitive multiplayer because it makes speed hacks and teleport exploits structurally hard — a modified client can lie about its inputs, but the server recomputes the outcome. The cost is latency: a player's input must round-trip before they see its effect, so you need client-side prediction and server reconciliation to keep it feeling responsive.

Client-authoritative. The client simulates and tells the server the result; the server mostly relays and persists. This is simple, cheap, and fine for cooperative games among friends, asynchronous play, or single-player-with-cloud-save. It's fatal for competitive play: the client can claim any position, any hit, any resource count.

Hybrid. The server owns the parts that matter for fairness (hit validation, economy, loot rolls) while clients own cosmetic or low-stakes simulation (animation state, local particle effects, sometimes movement in non-competitive modes). Many co-op games land here: the host's machine simulates enemies while the service validates progression and inventory.

The decision test is simple: ask what a cheater gains by lying. If the answer is "nothing that affects other players or the economy," client authority is defensible. If the answer is "rank, loot, or another player's loss," the server must own it.

One practical middle path worth knowing: server-recomputed movement with client prediction. The client moves its character immediately, sends the input to the server, and the server replays that input against the authoritative state. When the server's result diverges beyond a threshold, it sends a correction and the client snaps or smoothly interpolates. This is what makes an authoritative shooter feel like it responds instantly despite a 50 ms round trip.

Pick a tick rate and a network model that match your genre

The simulation tick is how often the server advances the world. It sets your CPU cost, your bandwidth, and your tolerance for latency — and it should be chosen from the game's timing needs, not from a benchmark leaderboard.

A useful frame: separate simulation rate from send rate. The server might simulate at 30 Hz but only send snapshots at 10–20 Hz, with clients interpolating between snapshots. Many action games run servers around 20–64 Hz simulation with client update rates in a similar band; the exact numbers are engineering choices, not laws. Higher tick rates shrink the window in which a fast-moving projectile can pass through a target undetected, but they multiply CPU and bandwidth roughly linearly.

Genre Timing tolerance Typical authority Practical simulation/send approach
Turn-based / card Seconds Server Event-driven; tick only on actions
MMO / open world 100–300 ms Server Low-frequency ticks, interest management
Co-op action 50–150 ms Hybrid Host or server simulates enemies; validate loot
Competitive shooter 10–50 ms Server High tick, prediction + reconciliation, lag compensation
Fighting / racing 16–50 ms Lockstep or server Determinism or rollback; tight input buffering

Two network models dominate. State synchronization sends periodic snapshots of world state; clients interpolate and predict. It's robust to packet loss and easy to reason about, at the cost of bandwidth proportional to the number of relevant entities. Deterministic lockstep sends only inputs and assumes all peers compute identical results; it's bandwidth-cheap and great for real-time strategy and fighting games, but a single desync or a player with a slow connection stalls everyone, and floating-point determinism across platforms is genuinely difficult.

Bandwidth math is worth doing early. Suppose 100 players in a match receive snapshots at 20 Hz, each snapshot is 400 bytes, and each player needs data about 50 nearby entities. That's 100 players × 20 snapshots/s × 400 bytes ≈ 800 KB/s aggregate, or 6.4 Mbps — modest. Now imagine 10,000 concurrent players across 100 such matches: 80 MB/s aggregate, which is a bandwidth bill more than a technical wall. Interest management (only send what a player can perceive) is usually the highest-leverage optimization, because it turns "everyone sees everything" into "everyone sees what matters."

Design the state model and decide what persists

Two questions: what state does the server keep in memory, and what does it write to durable storage?

In-memory state should be minimal and owned. A common mistake is letting every subsystem mutate shared player state freely; then a bug in one handler corrupts data another handler depends on. Instead, define a small set of authoritative entities (player, match, world region) with clear owners and a single mutation path — often an event queue processed once per tick. This makes replay, logging, and debugging tractable: you can record the input events for a match and re-simulate them.

Persistence has a spectrum. Writing every state change to a relational database is durable but slow at tick rates; batching writes (say, every few seconds or at match end) trades a small loss window for throughput. Write-ahead logs plus periodic snapshots give you crash recovery without per-frame database hits. In-memory stores like Redis are common for session state and matchmaking queues because they're fast and support atomic operations, but treat them as a cache with defined loss semantics, not as your system of record, unless you've deliberately designed for it.

The rule that saves teams: never let the database be in the hot path of the simulation loop. Persist asynchronously, acknowledge to the player only what the server has authoritatively decided, and design the loss window (if the server crashes, what does a player lose?) as an explicit product decision.

A worked estimate: if a match holds 10 players and each has 2 KB of state, a snapshot is ~20 KB. Writing that every 5 seconds for 100 concurrent matches is 100 × 20 KB / 5 s = 400 KB/s of writes — trivial. Writing every player action at 100 actions/s/match is 100 matches × 100 × 200 bytes ≈ 2 MB/s — also fine, but now you're in a regime where your database choice and indexing matter. Know which side of that line you're on.

Choose a topology and a scaling path before launch

Topology choices shape operations more than any code decision.

Single process per match. One server process hosts one match. It's simple, isolates failures, and matches the natural unit of a competitive game. Scaling means running more processes, which is straightforward if each match is stateless across restarts except for persisted results.

Region or shard servers. A persistent world is partitioned across processes by geography or game region, with players routed to the region owning their location and cross-region events (trades, chat) handled by a coordination layer. This is where MMOs live, and the hard problems are handoffs: when a player crosses a boundary, the two servers must agree on the transfer without duplicating or dropping state.

Session-based with matchmaking. A lobby service groups players, allocates a match server from a pool, and hands out connection credentials. The match server may be a container that lives only for the match. This is the dominant model for competitive and co-op games because it's elastic: scale the pool up for peak hours, down at night.

Whatever the topology, design the failure boundary explicitly. If a match server dies mid-game, do players reconnect to a new instance with restored state (requires frequent snapshots), or is the match forfeited (simpler, worse experience)? Answer this before you build, because it dictates snapshot frequency and reconnection protocols.

For scaling, the usual progression is: vertical first (a bigger box handles more matches), then horizontal by match (add more match servers behind a scheduler), then regional distribution. Don't build cross-region replication for a game that hasn't found its audience; the complexity is real and the payoff is speculative.

Matchmaking, sessions, and connection handoff

Matchmaking is a service that collects players, groups them by a rating and constraints (region, party size, game mode), and assigns them to a server. Two design points matter for the server itself.

First, allocation must be fast and safe under contention. If two matchmakers try to fill the same server slot, you need an atomic reservation — a queue entry with a lease, or a compare-and-set on the pool. Double-booking a match server is a classic launch-day bug.

Second, the handoff is a security boundary. When a player is matched, the matchmaker should issue a short-lived, single-use token that identifies the player and the match; the match server validates the token before accepting the connection. Never let a client tell the match server "I'm player 7"—let the matchmaker's signed token say so.

A simple check to validate the whole path: connect a client, complete a match, disconnect, and reconnect mid-match. If reconnection restores the player to the correct match with the correct state, your session design holds. If it drops them into a new match or duplicates their inventory, your identity and persistence boundaries are leaking.

Latency, prediction, and anti-cheat as one system

These three are usually treated separately, but they're the same problem: the server and client have different views of time and truth.

Client-side prediction makes input feel immediate: the client applies its own input locally, then reconciles when the server's authoritative snapshot arrives. Reconciliation needs to be cheap and correct — typically you keep a history of unacknowledged inputs and replay them against the corrected state. Get the history buffer wrong and players feel "rubber-banding" (snapping backward) even on good connections.

Lag compensation is the server's attempt to validate what a client saw. For hitscan weapons, the server can rewind other players' positions to where they were when the shooter's input was sent, then test the shot. This is necessary for fairness under latency and is also an attack surface: too much rewind history lets a cheater shoot at "past" positions. Keep the rewind window bounded (tied to maximum acceptable latency) and log discrepancies.

Anti-cheat, at the design level, is mostly about authority and observability. If the server owns outcomes, client-side cheats are limited to what the client can misreport: inputs and view angles. Design validation for those — physically plausible movement (speed and acceleration limits), fire-rate caps, impossible view transitions — and log violations rather than trusting client-side detection. Client-side anti-cheat software has a role, but a server-authoritative design means a cheater can't rewrite the game's rules, only lie within the input channel.

Data and persistence patterns that survive scale

Beyond the hot path, three patterns keep data sane.

Event sourcing for matches. Record the ordered input events for a match, persist them, and derive results by re-simulation. You get replays, dispute resolution, and crash recovery from the same log. The cost is compute on replay and the need for deterministic-enough simulation to make replays match.

CQRS for player profiles. Keep the write model (authoritative inventory, currency) separate from read models (leaderboards, profiles, trade listings) that can be rebuilt by replaying events. This lets you scale reads independently and fix a corrupted read model without touching truth.

Idempotent transactions for economy. Purchases, trades, and loot grants must be idempotent: retrying a request must not double-credit. Use idempotency keys and atomic compare-and-set operations. An economy bug that duplicates items is far harder to clean up than a match bug.

A concrete failure to plan for: two servers both believe they own a player's inventory during a region handoff and both accept a trade. Nothing in the code "disagrees"—the bug is a gap in ownership. The fix is a single ownership token per player with a lease and a fencing condition so stale owners can't commit writes. Test it by forcing a handoff during a trade and asserting exactly one commit.

Testing, observability, and knowing when to stop

You can't debug a distributed game server by reading logs during an incident. Build observability in early: per-tick timing, queue depths, snapshot sizes, reconciliation corrections per player per minute, and connection churn. A spike in corrections usually means a prediction bug or a network-regime change, not a player problem.

Test at three levels. Unit-test the simulation's rules deterministically. Then run load and chaos tests: simulate hundreds of bots, kill match servers mid-match, partition the network, and assert the product-level behavior (reconnect, forfeit, rollback) still matches the design. Chaos testing is where most topology bugs surface.

A specific stop condition: if your error rate or correction rate exceeds what the design's recovery path can absorb, stop tuning and revisit the authority or tick model. Adding more servers to a design with a broken ownership boundary just distributes the bug. And when you're changing persistence, economy, or matchmaking logic, get a second engineering review on the transactional boundaries—those are the failure modes that cause real financial and player trust damage, and they're worth the extra review even on a small team.

FAQ

Do I need a server-authoritative design for a casual co-op game? Not necessarily for fairness, but yes for the economy and progression. Even co-op games get exploited for item duplication and progression skips, so let the server own inventory, currency, and rewards while clients own enemy and physics simulation if that simplifies things.

What's the single biggest cause of rubber-banding? A mismatch between prediction and server reconciliation—usually a history buffer that's too short, inputs dropped on the client, or a server that's validating against state the client hasn't seen. Fix reconciliation before blaming the network.

How many players can one server process handle? It depends entirely on tick rate and entity density. Estimate it: measure CPU time per simulated entity per tick, multiply by players and nearby entities, and compare to your frame budget (1/tick_rate seconds). A process that spends 40 ms per tick can't run at 30 Hz.

Does this materially involve illegal or harmful instructions? No—this is ordinary software engineering guidance. If you're building a server for a regulated or paid product (real-money transactions, tax handling, gambling mechanics), the transactional and legal specifics need your own qualified review; that's beyond general design advice.