proomt

Search

Search posts, papers, and topics

Hall of Fame

Hall of FameBo Ingram202311 min readintermediate

How Discord Stores Trillions of Messages

Summary

Discord migrated its trillion‑message store from a problematic Cassandra cluster to ScyllaDB, adding Rust‑based data services that coalesce requests and hash‑route traffic to tame hot partitions and reduce latency.

  • Cassandra hot partitions caused cluster‑wide latency spikes because reads must scan many SSTables; writes are cheap but reads dominate traffic.
  • ScyllaDB removed Java GC pauses and offered shard‑per‑core isolation, but hot partitions still required upstream mitigation.
  • Rust data services expose a gRPC per query, coalesce concurrent reads, and use consistent‑hash routing so identical channel requests hit the same service instance.
  • Migration used dual‑write, Spark migrator, then a custom Rust migrator that checkpoints token ranges in SQLite for zero‑downtime bulk transfer.

Teams operating large, write‑heavy message stores need practical patterns for handling hot partitions and zero‑downtime migrations.

7/10

Related reading

  1. 1 points

    Saving another 100TB of RAM with math (and Rust)

    Cloudflare reduced the memory footprint of its Pingora Backend Router by re‑examining the consistent‑hashing implementation in the pingora‑ketama library. By increasing the number of virtual hash points per server from the default 1 to the standard 160 (and applying weighted hashing based on disk capacity), they cut the per‑node overhead enough to reclaim >100 TB of RAM across the fleet. The post…

    Hacker News front pagecloudflare.com13 minHN478120lobste.rs33
  2. OpenTelemetry everywhere: Migrating a metrics platform at scale

    Atlassian replaced its decade‑old gostatsd‑based metrics pipeline with a fully OpenTelemetry‑based stack by keeping the StatsD‑UDP contract on the client side and swapping in purpose‑built OTel Collector distributions for collection, ingest, aggregation, and forwarding. The migration was done incrementally, saved ~3.9% CPU per service, cut sidecar cost ~30% fleet‑wide, halved aggregation CPU, and…

    CNCFcncf.io6 minHN1
  3. Adding the Discord Updates YOU Want to See

    Discord’s latest update rolls out a batch of UI and moderation tweaks driven by community feedback: desktop DM pinning, channel pinning across all servers, audit‑log visibility for non‑members, a dedicated prune permission, role‑duplication shortcut, full‑size profile picture view, always‑visible search pagination, “Friends Since” timestamps, post‑send alt‑text & spoiler tags, bulk‑leave for inac…

    Discorddiscord.com4 min
  4. Postgres on NVMe: performance and the convergence of transactions and analytics

    Local NVMe storage cuts Postgres I/O latency from ms to µs, yielding ~9× higher TPS and 10× lower transaction latency on a 482 GiB pgbench workload. The gain comes from reduced IO wait, not more CPU work. To retain durability, combine NVMe with quorum synchronous replication and continuous WAL archiving (WAL‑G). For analytics, offload scans to ClickHouse via WAL‑based CDC (pg_clickhouse or the ne…

    ClickHouseclickhouse.com8 min
  5. Migrating the GitHub Copilot runtime to Rust, using Copilot

    The Copilot agent runtime was rewritten from a 130‑k‑line TypeScript/Node.js codebase into a native Rust library (~830 k lines of Rust) to reduce startup latency, memory use, and improve reliability. The migration was done incrementally (in‑place) across 128 PRs, with AI‑generated code handling most of the work. The new runtime exposes a C ABI for in‑process embedding by all six Copilot SDK langu…

    GitHub Oldgithub.blog65 minHN188