Cloud

Field note · 6 min

Figma shards Postgres

Vertical partitioning first, then horizontal sharding behind a query proxy.

In 2020 Figma kept most of its metadata (files, permissions, comments) in one Postgres database on Amazon RDS, running on the largest instance AWS offered. By 2024 its database stack had grown almost 100 times, and the team had sharded Postgres horizontally without leaving RDS and without switching databases.

Figma's two engineering posts describe the path in two stages: first splitting by table, then splitting tables themselves. It's a useful counterpoint to stories that end in a new database, because Figma deliberately stayed on managed relational databases and built the missing piece itself.

What they had

Tim Liang's 2023 post sets the scene. In 2020 traffic to the single RDS Postgres database was growing about three times a year, and peak CPU was reaching upwards of 65%. The team bought time the way the course's Part 1 does:

  • Scaling up: from an r5.12xlarge to an r5.24xlarge, the largest instance available.
  • Read replicas for reads that could tolerate lag.
  • New databases for new features, so they didn't add to the big one.
  • PgBouncer as a connection pooler.

As Liang puts it, "one machine has its limits".