Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Figma 10 min read Case study mediumAdept

Making multiplayer more reliable

Figma added a write-ahead journal to its in-memory multiplayer service, which previously persisted files only via full checkpoints to S3 every 30–60 seconds. Incremental changes are now batched and written to DynamoDB with sequence-number ranges. File ownership is enforced with a lock table and conditional writes to prevent split-brain corruption. Cross-region durability comes from guaranteeing a checkpoint within 30 minutes, since DynamoDB global tables would have cost about 6x more. After ~400K byte-identical replay validations during a dark launch, the journal handles over 2.2B changes per day, persists 95% within ~600ms, and removes checkpoint write spikes during deploys.

Assumes: write-ahead loggingWebSocket-based real-time syncDynamoDB conditional writes

Related posts

  • How does Turso Cloud keep your data durable and safe?

    Turso mediumAdept

    Turso Cloud makes every SQLite database durable on S3 and S3 Express, treating local server disk purely as a cache. Database files are split into 128kB segments grouped into generations, while recent WAL writes are acknowledged only after landing in low-latency S3 Express, with frequent checkpoints (around every 1MB). Segmenting enables lazy fetching, bounded per-tenant local storage and safe replacement of compute nodes. Continuous backups with 90-day point-in-time restore and instant metadata-only branching fall out of the same design.

  • How we scaled fast, reliable configuration distribution to thousands of workload containers

    Datadog Engineering mediumAdept

    Datadog replaced on-demand per-tenant config loading (database reads plus Kafka cache-invalidation messages) with a context-publisher that snapshots all tenants' configuration into RocksDB blobs in cloud storage and streams individual updates over Kafka. Because context data is only megabytes in total and changes thousands of times per day, every workload container can hold a full local replica. Containers download the blob at startup, apply streamed updates, and refresh the snapshot roughly every 10 minutes, so they keep working through a full outage of the central database. The design deliberately puts a tiny, externally unreachable service in charge and avoids bimodal fallback paths that would go untested and could overload the database.

  • How Figma’s databases team lived to tell the scale

    Figma mediumAdept

    Figma horizontally sharded its RDS Postgres stack after vertical partitioning ran out of room. Multi-terabyte tables were hurting vacuum reliability and approaching RDS IOPS limits. Instead of moving to CockroachDB, TiDB, Spanner, Vitess or NoSQL, the team built sharding on its existing Postgres fleet using several pieces: colocated table groups ("colos") that share a shard key such as UserID, FileID or OrgID; hash-based routing to avoid hotspots from auto-incrementing and Snowflake IDs; logical sharding via views, kept separate from physical shard splits; and a DBProxy query engine that parses and routes queries and also does load-shedding and request hedging. Deliberate tradeoffs included dropping atomic cross-shard transactions, accepting slower range scans, keeping rollback possible, and using full logical replication. Sharding the first table took nine months.

  • What it Takes to Recover a 100 TB Postgres Database in AWS RDS

    Neon easyNovice

    Recovering a 100 TB Postgres database on AWS RDS is slow or incomplete depending on the failure mode. Snapshot restore plus WAL replay handles logical errors, but copying the snapshot and replaying up to a day of WAL can take hours. Multi-AZ standbys cover AZ and hardware failures but cannot undo bad writes, double instance costs, and may silently drop to asynchronous replication and lag under heavy writes. Neon's alternative is presented: a versioned, log-structured key-value storage layer separated from stateless compute, which allows instant branch-based PITR and storage-level multi-AZ redundancy without a standby replica.

  • Introducing Husky, Datadog’s third-generation event store

    Datadog Engineering mediumAdept

    Husky is Datadog's third-generation event store, an unbundled, schemaless, vectorized column store that separates compute from storage on top of S3 and a FoundationDB-backed metadata store. The first-gen Logs system broke down through multi-tenant cascading failures. The second gen fixed that with custom sharding but couldn't handle tenant bursts or new product needs, so ingestion was split into stateless Writers, LSM-style distributed Compactors and Readers that coordinate through a strictly serializable metadata store. Because query capacity is decoupled from ingestion, queries can burst across many Readers or be isolated by product or tenant, for example keeping automated monitor queries apart from human ones.

The quest for software engineering knowledge.

Look:
Layout: