Persistent multiplayer state without chaos
How I keep a live multiplayer game consistent with PostgreSQL holding the truth and Redis doing the fast work
In a single-player game, state is easy. There’s one player, one save file, and as long as you don’t corrupt the file, you’re fine.
In a live multiplayer game, state is the hardest problem you’ll have. Two players can act on the same target at the same time. A scheduled job (a build, a launder, a raid) needs to resolve at exactly the right moment regardless of who’s online. A player can come back after three days and expect their progress to be where they left it, plus whatever happened in the world while they were gone.
You can’t naively keep this in memory. You can’t lazily flush to disk on logout. You need a real persistence story, and you need it to handle concurrent access without melting.
Here’s the architecture I landed on.




