BLUEPRINT #05Production Case Studies
Design Figma's 100x PostgreSQL Multi-Tenant Scaling Architecture
Target AWS Architecture:Aurora
Referenced Architecture Primitives (3)
Click any primitive to study its algorithmic deep dive10-Stage Structure:1. Requirementsβ2. Sizingβ3. Topologyβ4. Data Modelβ5. AWS Topologyβ6. Deep-Diveβ7. Failuresβ8. SRE Playbooks
1. Problem Statement & Scope Clarification
System Mission
Design Figma's collaborative cloud database and multi-tenant scaling infrastructure. Figma's multiplayer canvas operates over real-time WebSockets, persisting complex vector document graphs, version trees, user permissions, and comment threads. As Figma scaled , its single monolithic AWS Aurora PostgreSQL database experienced severe CPU exhaustion, table lock contention, and replication lag. The platform must scale to hundreds of sharded PostgreSQL nodes with zero downtime, zero data corruption, and seamless cross-shard routing.
Functional Requirements
- Multi-Tenant Document Persistence: Store hierarchical canvas document trees, node modifications, and organization metadata.
- Dynamic Shard Query Routing: Route SQL queries transparently to the appropriate database shard based on
org_idorfile_key. - Multiplayer Canvas State Sync: Persist real-time CRDT vector operations without blocking on slow OLTP queries.
- Live Zero-Downtime Shard Splitting: Split and migrate heavily loaded shards without dropping user WebSocket connections or causing canvas write errors.
Non-Functional Requirements (SLAs & SLOs)
- High Availability: uptime for canvas saving and file loading.
- Low Query Latency: , on sharded queries.
- Connection Scalability: Support concurrent application connections via PgBouncer connection multiplexing.
2. Capacity & Scale Estimation (Back-of-the-Envelope Math)
Scale Metrics
- Active Collaborative Design Files: .
- Canvas Vector Nodes per File: .
- Peak Query Throughput: against the database tier.
- Single PostgreSQL Limits: A maxed-out
db.r6g.16xlargeinstance (64 vCPUs, 512 GiB RAM) saturates at . - Sharding Requirement:
3. High-Level Architecture & Component Mapping
Interactive Architecture DiagramSynthesizing vector architecture diagram...
Part 2: Production Deep-Dive Locked1 Coin = 24 Hours
Unlock Complete Architecture & Production Runbooks
Your Balance:40 Coins
You have explored the free architectural preview (~48%). Spend 1 Coin to unlock the remaining 5 production deep-dive sections for a full 24 hours.
Sections Included in This 24-Hour Pass:
4. Deep-Dive: Figma's 100x Database Evolution
5. Data Model & Shard Routing Architecture
6. Live Zero-Downtime Shard Migration
7. Comprehensive Trade-off Matrix
8. Real-World Engineering Failure Modes & Post-Mortem Lessons
Keeps page unlocked for exactly 24 hoursSpend coins to fund LLM & compute infrastructure