Data and saving
What a game saves, how World reads, caches, and updates that keep games running.
Games on our servers save once, when they end. Games in your browser (the Sandbox) save nothing.
How it works now
- World, one Durable Object with its own SQLite, holds accounts, maps, the store and TagCoins, friends, matchmaking and the list of live games, and answers one request at a time. Chat, the Bot League and the status checker keep their own SQLite; Presence's 8 shards answer who's online.
- A game saves once, at its end: 8 players in 11.2 ms and 234 database calls (15 Nov 2026, a Mac busy with other work, about ±20%).
- World's load: busy 7.1% of the hour on the live request mix (was 9.2%), counted in statements (16 Nov 2026).
- Ids come from one table, id_seq, so an id is never handed out twice.
- Accounts: nothing is stored in the browser before sign-in; Download my data gives a JSON export; Delete account has a 7-day undo, then clears every column that held the account and holds the name 180 days.
Last checked: 16 Nov 2026.
Key decisions
| Decision | Why | Rejected | Date |
| One object, World, for accounts, maps and matchmaking | Not recorded | None recorded | 8 Nov 2026 |
| Busy work off World: an edge cache, Presence in 8 shards, chat in its own object | World ran out first: healthy to about 1,000 online before, 8,000 after | None recorded | 13 Nov 2026 |
| One read for many answers, kept in memory and dropped by the write that changes it | Every statement World runs is time no one else gets | None recorded | 16 Nov 2026 |
| The database bench counts statements, not milliseconds | A count doesn't move with the machine's load | Timing alone | 16 Nov 2026 |
| Ids from one id_seq table | Deleting the newest account gave its id to the next sign-up | AUTOINCREMENT: it means rebuilding each table, and the rename that ends a rebuild fails on the ledgers' triggers | 16 Nov 2026 |
| Delete clears every column in one list of the account's ids | Tables added later had been missed | Listing tables one by one in the delete | 16 Nov 2026 |
Changes that mattered
- 16 Nov 2026: World does the same work with about a quarter fewer statements (884 to 683 a second at 5,000 simulated players), and every Durable Object counts changed rows with SQLite's own count. The bug
- 16 Nov 2026: every sign-up failed on Cloudflare after the id change (Durable Object SQLite refuses reads of its internal tables); fixed the same day. The bug
- 16 Nov 2026: ids are never reused. Never reusing ids
- 16 Nov 2026: deleting an account left about 50 columns behind; now every one is cleared. The bug
- 16 Nov 2026: fewer statements: a friends list of 149 friends 309 to 12, the store 168 to 26. Fewer database reads
- 15 Nov 2026: a game end with 8 players went from 48.5 ms and 844 calls to 11.2 ms and 234. Making it fast
- 13 Nov 2026: healthy to 8,000 simulated online, from about 1,000. Ready for a crowd
Known limits and next
- World answers one request at a time and is the first thing to run out: 10,000 simulated online still held at p95 342 ms, past that not measured (Load tests).
- Splitting World into a maps object and account objects sharded by user id: designed, not built.
- The economy's finds from public games: built, off (switch ECONOMY_LIVE).
When a game ends
The room sends the result to World once, and World saves it in one go:
- the game and each player's stats and timeline
- rating, for ranked games
- XP, degree and season pass XP
- achievements, flairs and their TagCoins
- TagCoins and your win streak
- your pet's bond
- credit for the map's maker and texture pack makers
Your replays stay in your browser: How replays and clips work. The end screen's play of the game comes 1.5 seconds after the game ends.
Measured 2026-11-15 on one Mac with other work running (about ±20%), on a copy of the database at realistic size:
| Request | Before | After |
| Game end, 8 players | 48.5 ms, 844 database calls | 11.2 ms, 234 calls |
| Degree board | 728 ms | 1.0 ms (0.05 ms from memory) |
| Profile of the busiest player | 99 ms | 2 ms from memory, 64 ms at most once a minute |
How World reads
World answers one request at a time, so every database statement it runs is time no one else gets. The rules:
- One read, many answers. A profile's stats tables (today, week, month, all, the last 300, the best 300) come from one read of the newest 20,000 games, each window a prefix of it. A player's ratings for every queue come in one read, and a friends list's last games and last seen in one. A map page's numbers come in one statement, and player search looks names up in an index of name pieces instead of scanning every account.
- Kept in memory, dropped by the write. The maps index for unlisted maps, the published maps' rows, the site settings the map lists and the waiting line read, and each season board's placed ratings are kept once read. The one kind of write that changes each drops it: a map write, a settings change, a season result.
- Patched, not dropped. A vote updates that map's card in the kept map lists instead of throwing the lists away.
- Counted, not timed. The database bench counts statements per request, which doesn't move with a machine's load. Measured 16 Nov 2026: the store 168 to 26 statements, a profile 49 to 33, a friends list of 149 friends 309 to 12, a game end 303 to 239, and World busy 9.2% to 7.1% of the hour on the request mix.
Ids
An id is never handed out twice. SQLite numbers a new row the highest id plus one, so deleting the newest account gave its id to the next sign-up, with whatever still pointed at it. Now one table, id_seq, holds each table's highest id ever issued, and every insert takes the next with one statement (about 40 µs). A table's sequence starts at its highest id or a higher one still named elsewhere, so ids from before are skipped too. It covers accounts, notifications, messages, map comments and versions, feedback, wall posts, gifts, folders, claps, map reports, the fun ledger and the chats. AUTOINCREMENT would have meant rebuilding each table, and the rename that ends a rebuild fails on the ledgers' triggers. Random text ids (maps, clips, groups) come back only by chance. More: Never reusing ids.
The 100-value rule
Cloudflare's SQLite takes at most 100 bound values in one statement. Every query whose values grow with its input (a settings save, a list of ids, map search's filters) is listed and tested with 300 values; a big settings save is merged in code and saved as one value. The bench fails a statement over 100 as Cloudflare does, and a scan of the server code fails on a new builder of that kind that isn't listed. More: Fewer database reads.
Caches
- Lists the same for everyone are answered from a cache near you, kept from 3 seconds to 5 minutes.
- Pages you opened in the last 25 to 60 seconds show at once when you go back. Measured on our test copy (2026-11-13): going back to a page went from 41 ms to 13 ms.
- Things that change every second (live games, who's online, chat, your account) are never kept.
Updates without dropping games
- A running game keeps the code it started with. New games start on the new code, and anything still on old code after 30 minutes restarts.
- A room on old code restarts only at a calm moment: empty, warming up, counting down, or a Sandbox or Hangout. Players are back in a second or two.
- Before a planned update, pages show when it comes, and games show it 15, 5 and 1 minute ahead. A game that couldn't finish before the update waits to start.
- Matchmaking only puts you in rooms on the current game version.
- Open tabs keep working: the last build's files stay online, and a tab loads the new version at its next page change, never mid-game.