System design templates
Nine reference architectures you can run, break and fix — each with a scripted fault and a lesson to look for.
SmallSide project
One small server and an embedded database. Traffic ramps up until the single machine runs out of memory.
StartupSmall startup
Nginx in front of two app servers and one PostgreSQL. The app tier scales; the database becomes the bottleneck.
StartupCached web app
ALB → three EC2 servers using ElastiCache (cache-aside) in front of RDS PostgreSQL. At 60 s Redis is flushed.
Scale-upRead-heavy at scale
CloudFront → ALB → an auto-scaling group → Aurora with two read replicas. At 40 s the primary fails.
Scale-upAsync pipeline
API Gateway → Lambda → SQS → workers → DynamoDB. A traffic spike hits at 20 s.
Scale-upEvent-driven microservices
ALB → EKS → Kafka (MSK, 6 partitions, 60 s retention) → consumers → PostgreSQL and OpenSearch.
StartupServerless edge
Vercel functions → Neon Postgres, with Upstash Redis as a cache. Every function invocation can open a database connection.
GlobalMulti-region
Route 53 → two zones, each with an ALB and EKS → Aurora writer in zone A with a replica in zone B. Zone A fails at 40 s.
GlobalFeed / timeline
API servers → Redis → Cassandra. A celebrity post makes one key take 60% of the traffic.