System Design · Issue 4
How Supercell Handles Real-Time Persisted Events with ScyllaDB
Two engineers built the real-time social backbone for hundreds of millions of players. Here is the one abstraction that made it possible.

The constraint
Two engineers, hundreds of millions of players

Supercell runs five games that have each earned over $1B in their lifetime, together pulling in hundreds of millions of monthly players. The account and social backbone behind all of them, Supercell ID, was built and operated by a team of two engineers. That headcount shaped every technical decision that follows.
Supercell ID
- Clash of Clans
- Brawl Stars
- Hay Day
- Boom Beach
- mo.co
This one layer handles account recovery, friend graphs, chat, presence, notifications, and cross-game promotion. A larger team might build a separate service for each. Two people cannot maintain six systems, so they set out to build one.
How it grew
From an account API to a social network

It did not start ambitious. Supercell ID began as a plain HTTP API for account recovery and device migration: a client queries the account API and gets back signed tokens the game server trusts. Cross-player actions like friend requests rode a one-way event queue, where the account API posted an event and the game backend relayed it to the client over the game's existing socket.
When Edvard Fagerholm joined in late 2020, the driver was cross-game promotion: the team needed to push notifications to clients directly. That meant a fleet of proxy servers clients connect to, with routing that delivers events straight to the device and skips the game server.
- Account API (recovery, signed tokens)
- One-way queue (friend requests via game socket)
- Two-way proxies (push events to clients directly)
- Social layer (chat, presence, friend graph)
Then came the realization: that same two-way layer could absorb friend graphs, chat, presence, and teaming up, all the things that used to live inside each game server. Build it once at the ID layer and every future game inherits it for free.
The core idea
One abstraction instead of many

With effectively one engineer on the design, the bias was blunt: one abstraction that covers every use, not a purpose-built service per feature. The one thing they built is a hierarchical key-value store with broadcast. Top-level keys are topics clients subscribe to, and under each topic sits a two-layer nested map, map(string, map(string, string)).
We wanted to build one thing, not many.
Any change to data under a top-level key is broadcast to every subscriber of that key. Ordering rides on timestamps: every innermost value is timestamped, each data source controls its own ordering, and clients drop any update older than what they already hold.
<topic> ← clients subscribe here
└─ key2 map(string, ...)
└─ key3 → value@ts inner map, timestamped
any write under <topic> ⇒ broadcast to all subscribersThat last rule matters. Conflict handling lives on the client, so the server never has to reason about staleness. It just stores and forwards.
The data model
Chat and presence, same structure

The payoff is that things which look nothing alike ride the exact same structure. A chat message and a player's live battle status are stored identically.
CHAT
<room ID> (topic)
└─ <ts-uuid> (ordering key)
├─ message "hi there"
├─ metadata ...
└─ reactions ...
PRESENCE
<player ID> (topic)
└─ "presence" (type)
├─ weapon sword
├─ level 29
└─ status in battleFor chat, the topic is the room ID, the second-level key is a timestamp-UUID that gives both ordering and queryable history, and the inner map holds the message, metadata, and reactions. For presence, heavily used in the new game mo.co so teammates see each other's weapon, level, and status live, the topic is the player ID and the inner map holds the state itself.
Supercell ID never parses any of it. It does not know what a weapon is or what the friend graph means. It forwards opaque tuples and owns the routing; the game client, in turn, never has to know the friend graph at all.
Picking the database
Three criteria, one managed service

The database had to satisfy three things at once. It needed to handle many small writes with low latency, because the workload is a constant stream of tiny state deltas like level 10 → level 11. It needed a hierarchical model that matched the nested-map topic layout. And it needed to manage backups and cluster operations as a service, since two people cannot also be a full-time database ops team.
1 many small writes, low latency (level 10 → 11)
2 hierarchical map data model (topic → map → map)
3 backups + cluster ops managed (team = 2 engineers)
└────────────► ScyllaDB CloudWhat the sources don't tell us
The talk and blog are architectural, not a benchmark. There are no published p99 latencies, ops-per-second figures, cluster sizes, or cost comparisons for this system, and no alternative databases are named. This was the database chosen when building the system, not a migration from something else.
They landed on ScyllaDB Cloud, the fully managed version, for its predictable low latency at scale and for taking backups and cluster ops off the team's plate. Choosing managed means giving up some control in exchange for not having to run a database, a trade a two-person team happily makes.
The write path
Persist first, then broadcast

Three tiers do the work. APIs are thin: they rewrite incoming data into a canonical (topic, type, key, value) tuple. Proxies are what clients connect to, managing each client's subscriptions. Event routing servers hold the topics, sharded across the fleet, and persist every event to ScyllaDB.
client → proxy → router ──write──► ScyllaDB
│ (durable)
└──broadcast──► subscribers
(only after the write succeeds)Why sending the same event twice is safe
The system leans on idempotent client-side application plus timestamp-based staleness rejection rather than server-side exactly-once machinery. Replaying an event is harmless because the client already dropped or applied it. The one caveat: multiple sequence numbers can map to the same message.
The ordering is deliberate: every event is written to ScyllaDB before it is broadcast. The APIs are synchronous, so a success response means the data is already durable. That costs a little latency and buys a hard guarantee that an acknowledged write will survive.
When things break
Primary and backup shards

Each topic has a primary and a backup shard. The primary keeps in-memory sequence numbers per message so it can spot a dropped one. The backup stays passive and forwards messages without sequence numbers, so it does no loss detection while it is not in charge.
topic ├─ PRIMARY → tracks seq #s (loss detection) └─ BACKUP → forwards only (no seq #s, passive) primary down → up ⇒ client state refresh + seq reset
If the primary goes down and comes back, it triggers a client state refresh and resets sequence numbers, which reconciles any gaps rather than trying to replay seamlessly. Router reboots trigger automatic resubscription from the proxy layer, and on connect the proxy resolves a client's friends, chat groups, and personal topics in one shot.
On the wire
Load balancing at the TCP level

Two networking choices keep the fleet cheap to run. Protocol Buffers are the wire format, trimming bandwidth cost. And load balancing happens at the TCP level, not per HTTP/2 request, so every request on a connection lands on the same proxy socket. That lets the proxy cache session info in memory on connect and never refetch it per request.
client ──HTTP/2──► proxy ══persistent socket══► router
TCP-level LB (10k+ subscriptions/sec)
session cached
in memoryCoarse balancing works because with huge concurrent client counts traffic spreads out evenly and each user's requests cost about the same, so finer per-request control would add complexity for little gain. Persistent sockets between proxies and routers then let the team push tens of thousands of subscriptions per second to a single router, the one concrete throughput figure they shared.
The bottom line
Small team, one abstraction
Why it matters
A two-person team ran real-time social infrastructure for hundreds of millions of players by refusing to build more than one thing. The whole design bends toward that constraint: a single hierarchical-broadcast abstraction covering chat, presence, and friends, a managed database that erased ops work, and coarse load balancing justified by scale. Matching one data model to a database's strengths, and paying for managed operations, let a tiny team carry a load that usually demands a department.
The short version
- **Two engineers** built the account and social backbone for **hundreds of millions** of Supercell players across five games.
- One abstraction, a **hierarchical key-value store with topic subscribe and broadcast**, replaces separate chat, presence, and notification services.
- **ScyllaDB Cloud** was chosen for low-latency small writes, a hierarchical fit, and fully managed backups and cluster ops.
- Events are **persisted before broadcast** with synchronous APIs, so a success response means the write is already durable.
- The sources give no latency, throughput, or cost benchmarks beyond **tens of thousands of subscriptions per second** to a single router.
Sources
- 1.How Supercell Handles Real-Time Persisted Events with ScyllaDB — ScyllaDB Blog (Cynthia Dunlop, Jan 14, 2025)
- 2.Event Streaming NoSQL Resource Center – ScyllaDB
- 3.Real-Time Persisted Events at Supercell — ScyllaDB Summit 2024 talk (Edvard Fagerholm)
- 4.How Supercell Handles Real-Time Persisted Events with ScyllaDB | ScyllaDB
- 5.The New Stack on X: "How Supercell Handles Real-Time Persisted Events with ScyllaDB via @ScyllaDB, by @c_a_dunlop https://t.co/9qHYcXhRf1" / X
- 6.Real-Time Event Processing with CDC | ScyllaDB
- 7.ScyllaDB | High-Performance Database Case Studies
- 8.ScyllaDB
- 9.55 ScyllaDB Case Studies, Success Stories, & Customer Stories | FeaturedCustomers
- 10.Supercell Case Study
- 11.ScyllaDB Summit 2024 - Edvard Fagerholm on Why to Attend ...
- 12.Database Insights from Disney, Discord, & More at ScyllaDB Summit | ScyllaDB
- 13.ScyllaDB Summit 2024 | Robert W.
- 14.ScyllaDB Summit (Free + Virtual) Agenda Announced - Announcements - ScyllaDB Community NoSQL Forum
- 15.Company Events - ScyllaDB
- 16.A Deep Dive into ScyllaDB’s Architecture | ScyllaDB
- 17.Clash Royale League Live Events