Case 1
How to Approach System Design
Start with users and constraints — not databases. Clarify functional needs, non-functional targets, and what you can defer.
System design is the practice of mapping product requirements to components that store, move, and transform data. The same DDIA concepts — replication, partitioning, streams — appear in every case study; the skill is knowing which ones matter for each problem.
A repeatable framework
- Clarify scope: MVP vs full product, geography, scale today vs in 12 months.
- Functional requirements: core user journeys in plain language.
- Non-functional: latency targets, durability, consistency, cost, compliance.
- High-level diagram: clients → API → services → data stores → async pipelines.
- Deep dives: bottlenecks, failure modes, scaling levers.
- Trade-offs: what you optimize for and what you explicitly sacrifice.
Step-by-step walkthrough
Synchronous request path
- ① HTTPS — Browser or mobile client hits the CDN / reverse proxy (TLS termination, DDoS shield).
- ② REST/gRPC — Proxy forwards API calls to stateless application pods behind the load balancer.
- ③ OLTP read/write — API reads and writes authoritative rows in PostgreSQL (orders, accounts, inventory).
- ④ Cache hot keys — Sessions, rate counters, and hot reads go through Redis with TTL.
- ⑤ Search query — Full-text and facet queries hit Elasticsearch, not a table scan on Postgres.
Async derived-data path (dashed arrows)
- ⑥ Publish events — After a successful commit, the API appends a domain event to Kafka (outbox pattern).
- ⑦ ETL / CDC — Stream consumers copy changes into Snowflake for analytics and BI dashboards.
- ⑧ Index sync — Search index updates from the same event log — never dual-write to ES and Postgres in one request.
Why common infrastructure building blocks?
requirementsnon-functionaltrade-offsscopefailure modesCDNPostgreSQLRedisKafka