How Discord delivers a chat message to everyone in a server and stores it, built from Discord's own engineering posts. Play the traffic, switch scenarios, and click any component to see what it does and why it exists. The architecture and every figure about Discord are theirs; the traffic in the simulation is an illustrative model.
Each Discord server (a "guild" internally) has one guild process. "When anything is published in a guild, it is fanned out to every session connected to it." One process per guild gives every message a single, ordered path.
"Discord is a distributed system achieved through consistent hashing": a ring is used "to lookup the node of a particular entity". If a guild node fails, only the guilds on it move to other nodes. Try Node failure.
Learn more: Consistent Hashing
1. Deliveries
2. One guild process, sending to each session
3. With Manifold
4. Hot channel reads, coalesced
The 30 to 70 microseconds per send and the 900 ms to 2.1 s for large guilds are Discord's measurements from 2017. Step 4 is a simplification of coalescing: identical reads arriving while one query is in flight share its result, so one instance sends at most about one query per read time for a single row. Real systems also cache and batch, so treat these as orders of magnitude.
All are Discord's own engineering posts and developer documentation. Quoted phrases are short attributed quotations; everything else is described in our words. The simulation is an illustrative model; it does not reproduce Discord's real traffic.