The System Design Newsletter

The System Design Newsletter

Share this post

The System Design Newsletter
The System Design Newsletter
How Figma Scaled to 4M Users—Without Fancy Databases 🔥
Copy link
Facebook
Email
Notes
More
User's avatar
Discover more from The System Design Newsletter
Weekly newsletter to help busy engineers become good at system design
Over 148,000 subscribers
Already have an account? Sign in

How Figma Scaled to 4M Users—Without Fancy Databases 🔥

#69: Break Into Postgres Scalability (4 Minutes)

Neo Kim's avatar
Neo Kim
Apr 16, 2025
99

Share this post

The System Design Newsletter
The System Design Newsletter
How Figma Scaled to 4M Users—Without Fancy Databases 🔥
Copy link
Facebook
Email
Notes
More
9
10
Share

Get the powerful template to approach system design for FREE on newsletter signup:


This post outlines how Figma scaled the Postgres database. You will find references at the bottom of this page if you want to go deeper.

  • Share this post & I'll send you some rewards for the referrals.

Note: This post is based on my research and may differ from real-world implementation.

Once upon a time, 2 university students decided to build a meme generator.

Yet their business idea failed.

So they pivoted to create a design tool for the browser and called it Figma.

They stored metadata such as file information and user comments in a single Postgres database for simplicity.

Postgres Scale

Yet their traffic was massive.

And it affected latency and performance because of high CPU usage.

So they scaled vertically by installing Postgres on a larger machine. It means more CPU.

Vertical Scaling
Vertical Scaling

Although it temporarily solved their scalability issue, there were new problems.

Here are some of them:

1. Storage Capacity

Some tables grew extremely fast.

While smallest unit of partition is a table.

So a single database couldn’t handle their storage needs.

2. Performance

They received a ton of write operations.

It exceeded the input-output per second (IOPS) limit of a single database.

So the performance became poor.

Onward.


GibsonAI: AI-Powered Cloud Database - Sponsor

Ship and scale production grade apps at a blistering pace with GibsonAI, your AI-powered serverless database. With GibsonAI, you will:

  • Design your database with natural language and view it as a diagram (ERD) & code.

  • Deploy both dev and production environments in seconds with one click.

  • Access your database directly or through the secure REST API built for you.

  • Instruct GibsonAI to build, query, or update databases right from your favorite IDE via the GibsonAI MCP server.

  • Migrations, optimization and scaling handled for you.

Get Started for Free


Postgres Scale

Here’s how they scaled Postgres step by step:

1. Database Replication

They set up database replicas and route read traffic towards it.

Database Replicas to Scale Read Traffic
Database Replicas to Scale Read Traffic

It let them:

  • Handle more read traffic

  • Reduce latency by keeping data closer to users around the world

  • Increase fault tolerance as replicas could take over when the leader database fails

Yet replicas couldn’t handle some read operations because of replication lag and strong consistency needs. So they route those operations to the leader database.

Besides they added a caching layer to store frequently accessed data, thus reducing the database load.

Let’s keep going.

2. Database Federation

They moved tables into separate databases based on the domain.

Database Federation
Database Federation

It let them:

  • Scale horizontally by adding more databases

  • Spread workload across databases and reduce bottlenecks

For example, they store file information and user comments in separate databases because file information grows faster than comments. While the workload is different for each table.

Ready for the next technique?

3. Connection Pooling

They set up PgBouncer as the connection pooler.

It acts as a TCP proxy holding a pool of connections to Postgres.

And the client connects directly to PgBouncer instead of Postgres.

Connection Pooling
Connection Pooling

It let them:

  • Allow clients to reuse the same connection and improve throughput

  • Limit the number of database connections to avoid connection starvation

  • Keep persistent connections with the client to avoid expensive reconnection requests

4. Vertical Partitioning

They moved columns from high-traffic tables into separate tables.

And then stored those tables in different databases.

Yet each table has its own database. Put simply, a single table doesn’t spread across many databases.

Vertical Partitioning
Vertical Partitioning

It let them:

  • Isolate sensitive data for security

  • Reduce workload by routing traffic across many databases

  • Achieve high query performance by scanning only a subset of data

Yet vertical partitioning becomes a bottleneck with high write traffic. Because a single database wouldn’t be able to store a table with billions of rows.

Ready for the best part?

5. Horizontal Partitioning

They split tables at the row level and stored them across many databases for maximum scalability.

Horizontal Partitioning
Horizontal Partitioning

Also they set up a proxy server to route queries to the correct database.

Proxy Server for Topology Management
Proxy Server for Topology Management

It let them:

  • Rewrite expensive queries for performance

  • Manage database topology and support transactions

  • Drop extra requests when it exceed the threshold limit

They used the hash of the partition key to route write requests. Thus distributing data uniformly across databases.

Besides they co-located tables partitioned by the same key to make transactions and joins easier.


Figma became a popular design tool with over 40 million users.

This case study shows Postgres can easily handle internet-scale traffic.


👋 PS - Do you want to level up at work?

  • I’ll launch system design deep dives in this newsletter

  • Yet it’ll be available only to paid subscribers of the newsletter

My mission is to help you go from 0 to 1 in system design by spending less than an hour each month. But paid subscription fees will be higher than current pledge fees. So pledge today to get access at a low price.

"This newsletter is the perfect place to learn system design from big tech deep dives." Alexandre


Subscribe to get simplified case studies delivered straight to your inbox:


Author Neo Kim; System design case studies
Find me on LinkedIn | YouTube | Twitter | Threads | Instagram

Want to advertise in this newsletter? 📰

If your company wants to reach a 100K+ tech audience, advertise with me.


Thank you for supporting this newsletter. Consider sharing this post with your friends and get rewards. Y’all are the best.

system design newsletter

Share


TL;DR 🕰️

You can find a summary of this article on Twitter. Please consider a retweet if you find it helpful.


How Apple Pay Handles 41 Million Transactions a Day Securely 💸

How Apple Pay Handles 41 Million Transactions a Day Securely 💸

Neo Kim
·
Mar 27
Read full story
How Do Websockets Work ✨

How Do Websockets Work ✨

Neo Kim
·
Feb 28
Read full story

References

  • The growing pains of database architecture

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

  • Database Scaling at Figma with Sammy Steele

  • In Conversation: Dylan Field and Garry Tan on design, AI, and the power of locking in

  • How did Figma Succeed? A Brief History

  • PostgreSQL official site

  • Figma Statistics: Valuation, Funding & More

  • Figma on CNBC

  • The Story of Figma: Collaboration, Community, and Creativity

  • Block diagrams created with Eraser


Subscribe to The System Design Newsletter

By Neo Kim · Launched 2 years ago
Weekly newsletter to help busy engineers become good at system design
Eldest Pasirula's avatar
Vansh Thukral's avatar
Youssef's avatar
Himanshi Jain's avatar
Lorenzo Bradanini's avatar
99 Likes∙
10 Restacks
99

Share this post

The System Design Newsletter
The System Design Newsletter
How Figma Scaled to 4M Users—Without Fancy Databases 🔥
Copy link
Facebook
Email
Notes
More
9
10
Share

Discussion about this post

User's avatar
Raul Junco's avatar
Raul Junco
Apr 16

Here is a lesson on how different it is to scale read than write.

Thanks for sharing, Neo.

Expand full comment
Like (3)
Reply
Share
1 reply by Neo Kim
Petar Ivanov's avatar
Petar Ivanov
Apr 27

There are some very important tips like caching, separation of concerns, and dealing with heavy load.

Great breakdown, Neo! 🙌

Expand full comment
Like (2)
Reply
Share
7 more comments...
8 Reasons Why WhatsApp Was Able to Support 50 Billion Messages a Day With Only 32 Engineers
#1: Learn More - Awesome WhatsApp Engineering (6 minutes)
Aug 27, 2023 • 
Neo Kim
735

Share this post

The System Design Newsletter
The System Design Newsletter
8 Reasons Why WhatsApp Was Able to Support 50 Billion Messages a Day With Only 32 Engineers
Copy link
Facebook
Email
Notes
More
24
How PayPal Was Able to Support a Billion Transactions per Day With Only 8 Virtual Machines
#30: Learn More - Awesome PayPal Engineering (4 minutes)
Dec 26, 2023 • 
Neo Kim
245

Share this post

The System Design Newsletter
The System Design Newsletter
How PayPal Was Able to Support a Billion Transactions per Day With Only 8 Virtual Machines
Copy link
Facebook
Email
Notes
More
14
How Stripe Prevents Double Payment Using Idempotent API
#45: A Simple Introduction to Idempotent API (4 minutes)
May 9, 2024 • 
Neo Kim
380

Share this post

The System Design Newsletter
The System Design Newsletter
How Stripe Prevents Double Payment Using Idempotent API
Copy link
Facebook
Email
Notes
More
29

Ready for more?

© 2025 Neo Kim
Publisher Privacy
Substack
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share

Copy link
Facebook
Email
Notes
More

Create your profile

User's avatar

Only paid subscribers can comment on this post

Already a paid subscriber? Sign in

Check your email

For your security, we need to re-authenticate you.

Click the link we sent to , or click here to sign in.