Interview knowledge

System design map

A typical architecture, one layer at a time. Each box opens what I've written about that component. Greyed boxes are gaps I haven't written up yet.

Common problems

Pick a problem to light up the building blocks that solve it. From Common System Design Patterns.

Numbers to know

Rough orders of magnitude for back-of-the-envelope estimates. Each one links to the note it comes from.

Speed

Memory vs disk reads
โ‰ˆ10,000ร— fasterWhy a cache in front of the database pays off.Caching

Throughput

Redis throughput
โ‰ˆ100k req/sPer instance, rough order of magnitude.Redis
PostgreSQL reads
โ‰ˆ20k queries/sSingle instance.PostgreSQL
PostgreSQL writes
โ‰ˆ5โ€“10k writes/sSingle primary; beyond this consider sharding or a write-optimised store.How to choose a database
When DynamoDB starts to make sense
> 10k writes/sHeavy writes with key-value access patterns.PostgreSQL vs DynamoDB

Storage

Single PostgreSQL gets uncomfortable
โ‰ˆ100 GB โ€“ 1 TBMaintenance, vacuum and backups get painful; technical limit is far higher.PostgreSQL
Aurora storage
up to 128 TBGrows automatically in 10 GB increments.AWS Aurora
One user row
โ‰ˆ1 KBIncluding overhead; raw fields are ~150 bytes (ids 8โ€“16 B, email 30โ€“60 B, bcrypt hash 60 B).How much data is a user in a database roughly