System Design quick reference

299 entries — one card per concept, for looking something up rather than learning it. Each links back to the full explanation.

299

System Design Fundamentals

4

requirement → architecture + data flow + APIs + storage + failure handling

The five things a system design must make explicit that a plain-English requirement leaves implicit.

functional / non-functional / constraint / assumption / capacity / latency / ...

The twelve terms every later system-design section assumes you already know.

"10M req/day, p95 < 300ms, 99.95% uptime" -> capacity + 2 non-functional requirements

functional (what) + non-functional (how well, with a number)

Every feature needs both — the second is what makes the first testable.

"users can upload files" + "p99 < 2s" = one testable requirement

Functional vs Non-Functional Requirements

4

feature / workflow / business rule / user action / data produced / external integration

The six categories a functional requirement falls into.

latency / throughput / availability / durability / consistency / scalability / security / observability / recoverability / compliance / cost

The eleven non-functional categories, grouped by what they measure.

10M req/day · p95 < 300ms · 99.95% availability · RPO 5min · RTO 30min

A realistic, fully measurable requirements block, and what each figure implies for design.

requirementsnon-functionalcapacity
Worked numeric examples

Requirements Clarification

4

users · clients · use cases · read/write · volume · retention · region · traffic · peak · SLA · security · regulatory

The twelve questions to answer before drawing a single component.

read-heavy / write-heavy / bursty / interactive / batch-oriented / real-time / event-driven

The seven traffic shapes, each pointing toward a different architecture — a system is usually several at once.

requirementsclarificationtraffic
Naming the traffic shape

strong: a stale read breaks something · eventual: a stale read is barely noticeable

The test for whether one piece of data needs strong or eventual consistency.

account balance -> strong · like count -> eventual

requirementsclarificationconsistency
Drawing the consistency boundary

sync: the caller needs the result · async: the caller only needs "accepted"

The test for whether one workflow step must complete inline or can move off the request path.

charge payment -> sync · send confirmation email -> async

requirementsclarificationasync
Drawing the synchronous boundary

Capacity Estimation

5

RPS · storage growth · bandwidth · memory · queue volume

The five numbers a capacity estimate needs before any component is chosen.

avg RPS = req/day ÷ 86,400 · peak RPS = avg × factor · storage = records × size × multiplier

The three formulas behind most capacity estimates.

capacityestimationformulas
The core capacity formulas

DB reads/sec = reads/sec × (1 − cache hit ratio) · growth = writes × size × replication

Second-layer capacity math: read/write split, cache hit ratio, and replicated storage growth.

capacityestimationcachingreplication
Reads, writes, cache hits and growth

quick avg RPS ≈ requests/day ÷ 10^5 (86,400 seconds/day rounds up to ~10^5)

Fast mental-math shortcut for a daily-total-to-RPS estimate, refined afterward with ÷86,400.

capacityestimationmental-math
Powers-of-ten approximation

server count = ceil(peak RPS ÷ RPS-per-server × (1 + headroom))

Turning a capacity estimate into an actual infrastructure count, not a guessed server number.

capacityestimationinfrastructure
From estimate to infrastructure

Back-of-the-Envelope Math

4

bandwidth · storage · memory · cache size · queue depth · CPU needs · database IOPS

The seven quantities a back-of-the-envelope pass covers, fast and rounded.

capacityestimationback-of-envelope
What a back-of-the-envelope estimate covers

peak = avg × factor (once) · growth: size(N) = today × (1 + rate)^N (compounds)

A same-day peak multiplier vs a compounding growth rate over time — different math, both needed.

Latency and Throughput

5

latency = time/operation · throughput = operations/time

The two axes every performance conversation needs to separate.

latencythroughputperformance
Latency vs throughput

mean = sum(latencies) / count — dilutes outliers; use p99/p99.9

A mean blends a few very slow requests into a much larger fast group; percentiles report an actual value instead.

latencypercentilestail-latency
Why averages hide tail latency problems

Availability, Reliability and Durability

4

99% ≈ 3.65d/yr · 99.9% ≈ 8.76h/yr · 99.99% ≈ 52.6min/yr · 99.999% ≈ 5.26min/yr

Allowed downtime per year at each availability "nine".

availabilityuptimeninessla
Uptime "nines" and what they allow

redundancy + health checks + failover; backups + replication; DR

Seven techniques, four guarantees — redundancy needs health checks and failover to matter; backups and replication protect data differently.

availabilityreliabilitydurability
The redundancy and recovery toolkit

SLIs, SLOs, SLAs and Error Budgets

3

SLI = measured · SLO = internal target · SLA = external contract

The three layers of a service level commitment.

Basic Architecture Patterns

7

client → application → database

The most common starting architecture for a web system.

architecturethree-tier
Three-tier architecture

presentation → application → domain → data access → storage

Each layer only calls the layer directly below it; domain logic stays free of I/O.

architecturelayereddomain
Layered architecture

one deployable + enforced module boundaries + module-owned data

A single deployable with real internal boundaries, distinct from a plain monolith or microservices.

architecturemodular-monolith
Modular monolith

independent services + own data + network communication

Multiple independently deployable services with explicit network boundaries.

architecturemicroservices
Microservices

producer --publish--> broker --route--> consumer(s)

Producers publish events without knowing or waiting on consumers; new consumers subscribe independently.

architectureevent-drivenmessaging
Event-driven architecture

ingestion → processing → storage/output

Each pipeline stage has one job and feeds the next stage's input format.

architecturepipelinedata
Pipeline architecture

Monolith vs Modular Monolith vs Microservices

5

simpler deploy · local calls · easier transactions · lower ops overhead

The four advantages a plain monolith has over a distributed architecture.

monolithtrade-offs
Monolith advantages

modular monolith = real boundaries + no network cost

Enforced module boundaries and data ownership, still one deployable — the coupling fix without the microservices network bill.

monolithmicroservicesarchitecture
Modular monolith advantages

independent scaling · independent deployment · independent ownership

The three advantages microservices provide over any monolith shape.

microservicestrade-offs
Microservices advantages

network calls · distributed transactions · observability · ops overhead · eventual consistency · new failure modes

The six costs microservices pay for their independence.

microservicestrade-offsdistributed-systems
Microservices costs

Client-Server and API Gateways

3

client → load balancer → API gateway → backend service(s)

The layers a request passes through before business logic runs.

client-serverapi-gatewayreverse-proxyload-balancer
Client-server topology

gateway: routing + auth + rate limit + aggregation + observability, never business logic

What an API gateway should and should not own.

api-gatewayauthenticationrate-limitingaggregation
API gateway responsibilities

Load Balancing

4

L4 = IP/port only · L7 = full HTTP request

The two layers a load balancer can operate at.

load-balancingl4l7networking
L4 vs L7 load balancing

round robin · weighted round robin · least connections · hashing · consistent hashing

The five algorithms a load balancer can pick an instance with.

load-balancingconsistent-hashinground-robin
Load balancing algorithms

Horizontal vs Vertical Scaling

3

vertical = bigger machine, hard ceiling · horizontal = more machines, needs distributable workload

The two directions a system can scale in.

scalinghorizontal-scalingvertical-scaling
Horizontal vs vertical scaling

Stateless Architecture

3

disposable instance = no unique state + safe to kill and replace anytime

What makes an instance safe to auto-scale, redeploy, or recover automatically.

statelessdisposabilityauto-scaling
Disposable application instances

shared state → database | cache | object storage | queue, never one instance alone

Where state that must outlive a single request or instance actually belongs.

statelessshared-statesession-store
Moving shared state out of the instance

Database Fundamentals for System Design

3

relational: consistency + joins, harder scale-out · non-relational: scale-out + flexible schema, weaker joins

The system-design-level trade-off between a relational and a non-relational data model.

one DB → ACID transaction · multiple services → needs an explicit saga/outbox strategy

Recognizing when a logical transaction crosses a service boundary a single database cannot cover.

transactionssagamicroservicesconsistency
When a transaction must span multiple services

Data Modeling

3

Isolation Levels and Concurrency

4

Read Uncommitted < Read Committed < Repeatable Read < Serializable

The four standard SQL isolation levels, from weakest to strongest.

isolation-levelstransactionsconcurrency
The four SQL isolation levels

Replication

3

replicas scale reads, not writes · every replica read trades freshness for capacity

What routing reads to replicas gains and what it can silently cost in consistency.

replicationread-replicasconsistency
Read replicas and the consistency implications

Sharding and Partitioning

3

Caching Fundamentals

4

TTL = time-based · eviction = space-based (e.g. LRU) · invalidation = write-triggered

The three ways an entry leaves a cache, and why invalidation alone is risky without a TTL backstop.

cachingttlcache-invalidation
TTL, eviction and invalidation

warming = pre-load before traffic · negative caching = cache the "not found" too

Two specialized cache techniques beyond TTL/eviction/invalidation.

cachingcache-warmingnegative-caching
Cache warming and negative caching

Redis and Distributed Caching

3

stampede = synchronized misses · hot key = one key overloads one node · pressure = watch evictions

Three distinct ways a distributed cache breaks down under real load.

CDN and Edge Caching

3

Messaging and Queues

3

Kafka and Log-Based Messaging

4

RabbitMQ and Traditional Message Brokers

3

producer → exchange (direct/fanout/topic) → binding → queue → consumer

RabbitMQ's core AMQP routing model — always through an exchange, never directly to a queue.

Delivery Semantics and Idempotency

3

idempotent = same end result no matter how many times applied — needs an atomic check, not just a unique ID

What makes a consumer safe under at-least-once delivery's expected duplicates.

idempotencyconsumer-designat-least-once
Designing consumers to be idempotent

Retry Strategy

5

GET/PUT/DELETE -> safe to retry; POST/relative updates -> only retry if idempotency-guarded

When a retry can safely repeat a request versus when it risks duplicating a side effect.

Timeouts and Resource Limits

3

Circuit Breakers and Bulkheads

4

Closed (normal) → Open (fail fast) → Half-Open (trial) → Closed or back to Open

The three-state machine every circuit breaker implementation follows.

circuit-breakerstate-machineresilience
The closed, open and half-open states

Eventual Consistency

3

ask: what is the real cost if THIS read is 5 seconds stale? — decide per workflow, not system-wide

How to choose between eventual and strong consistency for a specific workflow, not the whole system.

eventual-consistencystrong-consistencyconsistency-models
Choosing eventual vs strong consistency per workflow

Distributed Transactions

3

each database is only ACID with itself — no shared commit boundary exists across services by default

The structural reason cross-service atomicity is hard, not a solvable gap in any single database's design.

distributed-transactionsacidmicroservices
Why cross-service ACID transactions are difficult

2PC: prepare/vote → commit or abort, all-or-nothing — real atomicity, real blocking cost

The two-phase commit protocol and the specific coordinator-failure scenario that makes it fragile.

two-phase-commitdistributed-transactionscoordination
Two-phase commit, and why it is expensive and fragile

saga: local transactions commit independently + explicit compensating actions on failure — no cross-service locks

Why sagas are generally preferred over 2PC for cross-service workflows, and the real cost (visible intermediate states, non-symmetric compensation) that trade-off carries.

Saga Pattern

3

orchestration: one coordinator explicitly directs every step and every failure decision

Centralized saga coordination — easier to trace and debug, at the cost of a more tightly-coupled, single point of workflow control.

Transactional Outbox and Inbox

3

INSERT event_id INTO inbox (unique) → then apply effect, same transaction

The inbox pattern: recording processed event IDs atomically with the effect they cause, so redelivery is a safe no-op.

inboxdeduplicationidempotent-consumer
The inbox pattern: recording processed event IDs

Distributed Locks

3

UPDATE ... WHERE <condition> RETURNING ... — atomic check-and-act in one round trip

Prefer a unique constraint or atomic UPDATE over a distributed lock whenever the invariant fits in one database operation.

distributed-locksunique-constraintcompare-and-setatomic-update
Prefer database uniqueness or atomic operations over a lock

Consistent Hashing

3

ring[hash(node_id + "-" + i)] = node, for i in 0..virtual_nodes_per_node

Hashing each physical node to many ring positions to even out load.

consistent-hashingvirtual-nodesload-balancing
Virtual nodes and why they even out load

Consistency Models

3

ask "what does THIS operation do during an actual partition?" — not "what's our one-word CAP label?"

Using CAP as a concrete design-reasoning tool rather than a shallow system-wide label.

cap-theoremconsistency-modelssystem-design-reasoning
CAP as a reasoning framework, not a slogan

CAP Theorem

3

partition + conflicting operation -> choose Consistency or Availability

The precise moment the CAP theorem describes, and the two options at that moment.

cap-theoremconsistencyavailabilitypartition-tolerance
What CAP actually says

"pick 2 of 3" (myth) vs. "choose C or A, only during a partition" (accurate)

The corrected reading of CAP: a temporary, partition-scoped trade-off, not a permanent global choice.

cap-theoremcommon-misconceptionpartition-tolerance
CAP is not "pick 2 of 3, permanently"

PACELC

3

if Partition: A or C; else: L or C

PACELC extends CAP theorem by naming the latency/consistency trade-off that exists even without a partition.

pacelccap-theoremconsistencylatency
PACELC extends CAP to normal operation

Ask "PA or PC?" then "EL or EC?" — independently, per operation

A two-question checklist for classifying any replicated system's PACELC behavior.

pacelcdynamodbevaluationconsistency
Using PACELC as an evaluation checklist

Leader Election and Coordination

3

lease = "leader until time T" — expires unless renewed before T

How a leader proves it is still alive and in charge: heartbeats signal liveness, leases bound it with an expiry.

leader-electionheartbeatleasefailover
Leader/follower roles, heartbeats and leases

split-brain: two nodes, one partition, both believing "I am leader"

Why failover after a network partition (not a crash) can produce two simultaneous leaders, and what actually prevents it.

failoversplit-brainpartitionfencingquorum
Failover and the split-brain risk

ZooKeeper (ZAB) / etcd (Raft) — a consensus-backed store for "who is the leader"

What coordination systems solve conceptually: a consistent, fault-tolerant place to store shared state like leadership, so applications don't implement split-brain-safe election themselves.

zookeeperetcdconsensusraftcoordination
Coordination systems: ZooKeeper, etcd and consensus

Consensus

3

agreement on ONE value/order, despite crashes + lost messages

The general distributed-systems problem that consensus protocols solve.

consensusdistributed-systemssplit-brainfault-tolerance
Why nodes need agreement under failures

app services → client of a small etcd/ZooKeeper consensus cluster

How Raft/Paxos-style consensus shows up in real systems: leader election, distributed locks, config stores.

etcdzookeeperdistributed-locksconsensuscoordination
Where consensus actually gets used in practice

Object Storage

3

bucket → key (object: data + metadata), versioned by write/delete

The core S3-style object storage model — a flat namespace of immutable, versioned objects addressed by key, with lifecycle rules automating storage-class transitions and expiration.

object-storages3bucketsversioninglifecycle-rules
The object storage model: buckets, keys, metadata, versioning

CreateMultipartUpload → UploadPart × N → CompleteMultipartUpload | presign(key, expiresIn)

Multipart upload splits a large object into independently-retriable parts (recommended at 100 MB+); a signed URL grants one caller's time-limited access to a single object action without sharing credentials.

object-storages3multipart-uploadsigned-urlspresigned-urls
Multipart upload and signed URLs

client --(signed URL)--> object storage, app server records metadata only

Route large durable files directly to object storage instead of relaying them through an application server, keeping the app server's job to metadata only.

object-storagearchitecturefile-uploadssigned-urls
Object storage instead of application servers for large files

Search Systems

3

LIKE '%term%' → full scan, no ranking — B-trees can't do relevance

A leading-wildcard LIKE defeats a B-tree index; reach for a search engine once ranking, fuzzy matching, or faceting outgrows built-in full-text search.

searchindexingfull-text-search
When database search is insufficient

term -> [document IDs] (built via tokenize -> analyze -> index; queried via tokenize -> analyze -> lookup -> filter -> rank)

The inverted index and the analysis pipeline that builds and queries it.

inverted-indextokenizationanalyzerrankingbm25
Inverted indexes, tokenization, analyzers and ranking

primary store (authoritative) → indexing pipeline → search engine (derived)

Elastic/OpenSearch are specialized for ranked, faceted search, not ACID transactions or being the source of truth.

Rate Limiting

3

Quotas and Fairness

3

quota: total ≤ limit per period · burst: rate ≤ limit per second

A hard quota bounds total usage over time; a burst limit bounds instantaneous rate — distinct controls, often applied together.

quotasburst-limitstoken-bucketrate-limiting
Hard quotas vs burst limits

one tenant heavy → other tenants (flat traffic) degrade too

The diagnostic signature and fix for one tenant monopolizing a resource shared across tenants.

noisy-neighbormulti-tenancyresource-isolation
The noisy-neighbor problem

Real-Time Systems

3

directionality → connection count → frequency → ordering → infrastructure → client support

The six-factor funnel for choosing between polling, long polling, SSE and WebSockets.

decision-frameworkwebsocketsssepolling
Six factors for choosing a real-time transport

connect → open → heartbeat → close → reconnect; bounded buffer + drop/disconnect/coalesce

The stages a long-lived connection moves through, and the three standard responses to one client falling behind.

websocketsbackpressureheartbeatconnection-lifecycle
Connection lifecycle and backpressure

WebSockets at Scale

3

registry: user/connection ID → holding instance

How WebSocket connection affinity forces a shared registry so other instances can find where a connection lives.

websocketsconnection-affinitysticky-sessions
Connection affinity and connection registries

PUBLISH channel msg → every subscribed instance → local-only delivery

Redis Pub/Sub or a broker relays a message to every instance so the one holding the target connection can deliver it.

Batch and Stream Processing

3

batch: bounded input, scheduled, exits | stream: unbounded input, continuous, never exits

The two processing paradigms and the freshness-vs-simplicity trade-off between them.

batch-processingstream-processingetl
Batch vs stream processing

window (bounds the stream) → state (running aggregate) → checkpoint (state + offset saved) → replay (resume from there)

The vocabulary a stream processor needs because its input has no end and a crash cannot mean starting over.

windowingcheckpointingreplaystream-processingstate
Windowing, state, checkpointing and replay

throughput ↑ + latency ↑ together via batching | backpressure = input rate > processing ceiling

The throughput/latency trade-off a stream processor tunes, and backpressure as the failure mode when input outruns it.

throughputlatencybackpressurestream-processingmicro-batching
Throughput, latency and backpressure in stream processing

Backpressure

3

producer rate > consumer rate, unbounded → memory growth → OOM

The producer/consumer rate mismatch backpressure exists to control, and what happens without it.

backpressurequeuesflow-control
What backpressure is and why it matters

File and Large Data Processing

3

DB row: { object_key, size, content_type, owner } — blob bytes live in object storage

Keep a file's metadata in a small database row that references the blob by key, instead of storing the blob's bytes directly in the database.

metadatablobsobject-storagedatabase-design
Separate metadata from blobs

API Design

5

?offset=40 (skip N) vs ?cursor=abc123 (after this row)

Offset pagination is simple but unsafe under writes; cursor pagination is safe and fast but cannot jump to an arbitrary page.

{ "error": { "code", "message", "details", "requestId" } }

A stable id never changes for the resource's life; a consistent error contract gives every failure a machine-readable code.

API Gateway and BFF

3

API gateway: one contract, every client · BFF: one backend, one client experience

When to share one gateway contract versus tailoring a backend per client.

api-gatewaybffbackend-for-frontend
API Gateway vs Backend-for-Frontend

thin router + fixed cross-cutting concerns, forever — not "just add it here" one more time

The anti-pattern where a gateway accretes logic until it is a single point of failure nobody can test.

api-gatewaybffanti-patternsingle-point-of-failure
The gateway that became an untestable monolith

API Idempotency

1

Idempotency-Key: <client-generated> — store the outcome, replay it on retry

How POST/command requests get the same retry-safety GET/PUT/DELETE have for free by HTTP semantics.

idempotencyidempotency-keyposthttp
Idempotency keys for POST/command requests

Authentication and Authorization

5

session+cookie = stateful, revocable | JWT = stateless, expiry-only

The core trade-off between server-side session state and self-contained signed tokens.

authenticationjwtsessionscookies
Session/cookie auth vs token (JWT) auth

Security Architecture

3

secrets manager (never in source) -> encrypt -> rotate on a schedule -> audit log every access

The operational controls that keep a secure design secure over time.

secrets-managementkey-rotationaudit-logsencryption
Secrets management, key rotation and audit logs

Encryption

3

bcrypt.hashpw() / argon2.hash() — never encrypt(password)

Passwords are hashed one-way with a slow, purpose-built algorithm — never encrypted with a reversible cipher, and never hashed with a fast general-purpose hash.

encryptionpasswordhashingbcryptsecurity
Password hashing: why it is not encryption

Multi-Tenancy

3

shared schema: quota mandatory · separate schema: quota still needed, smaller blast radius · separate DB: quota moves to the shared layer above it

How the three tenancy models change where noisy-neighbor risk and per-tenant quotas actually apply.

Observability

3

logs (detail) + metrics (aggregate trends) + traces (cross-service request path)

The three complementary data shapes that make up observability — none of the three substitutes for the others.

observabilitylogsmetricstraces
Three pillars: logs, metrics and traces

sync: context rides HTTP headers · async: context serialized into the message and extracted by the consumer

How a single trace stays connected across both synchronous service calls and asynchronous, queue-based workflows.

observabilitydistributed-tracingasyncqueues
Tracing cross-service requests and asynchronous workflows

Monitoring and Alerting

3

resource% alone → false pages + missed incidents; symptom + resource-as-context → both fixed

Why alerting only on raw infrastructure metrics fails in both directions, and what to alert on instead.

monitoringalertinganti-patternalert-fatigue
Avoiding infrastructure-noise-only alerting

SRE and Operational Thinking

2

Disaster Recovery

3

High Availability

3

audit all 7 layers: LB, app, DB, cache, queue, storage, network

Each layer on the request path needs its own explicit redundancy decision -- one un-redundant layer caps the whole system's availability.

active-active = all nodes serve now; active-passive = standby promoted on failure

Active-active trades consistency complexity for failover speed; active-passive trades failover speed for a single-writer simplicity.

high-availabilityactive-activeactive-passivefailover
Active-active vs active-passive

Multi-Region Systems

3

latency | disaster recovery | data residency | global availability

The four independent business requirements that justify the cost of a multi-region architecture.

multi-regionlatencydisaster-recoverydata-residency
The four real reasons to go multi-region

name the reason -> attach a number/citation -> rule out single-region -> only then build

The gate that catches prestige-driven multi-region adoption before it pays the eight-challenge cost for nothing.

multi-regionanti-patterncostdecision-making
Do not go multi-region without a clear business reason

Autoscaling

2

metric polled → compared to target → replica count changed

What decides when horizontal autoscaling fires — CPU, memory, request rate, queue depth, or a custom metric matched to the workload's real bottleneck.

autoscalinghorizontal-pod-autoscalermetricsqueue-depth
Autoscaling triggers and metrics

Container and Kubernetes Concepts

1

orchestration layer (Kubernetes) != architecture (service boundaries, data ownership, failure behavior)

Operating Kubernetes fluently is a distinct skill from being able to explain the system design decisions underneath it.

kubernetescontainersarchitectureinterview
Orchestration is not architecture

Cloud Architecture

2

LB + compute + managed DB + object storage + queue + cache + IAM + networking + observability = a cloud's menu

The nine generic system-design components as they map onto any major cloud provider's provisionable services.

cloudarchitecturemanaged-servicesinfrastructure
A cloud provider's menu as system-design building blocks

prefer managed IF (ops burden saved) > (lock-in severity + cost at scale), else self-host

A workload-by-workload trade-off between operational burden saved, lock-in severity, and cost at actual scale — not a blanket rule.

cloudmanaged-serviceslock-incosttrade-off
The managed-vs-self-hosted trade-off

Cost-Aware Design

3

size for realistic traffic + headroom + a documented migration trigger, not for an unquantified maximum

Why over-engineering for hypothetical scale is a continuous cost, and how to size for the traffic a product actually has.

costover-engineeringcapacity-planningright-sizing
Right-sizing, not maximum scale

Data Lifecycle and Retention

2

hot (fast, expensive) → warm (medium) → cold (cheap, slow) — independent of retention length and legal-hold status

Storage temperature tiers by access pattern, and how retention and legal holds are separate axes on top of them.

data-lifecycleretentionlegal-holdstorage-tiering
Hot vs warm vs cold data, and retention policies

TTL (per-record) · lifecycle rule (blob storage) · partition pruning (drop, not scan) · archival pipeline (batch to cold)

The four automated mechanisms that enforce a retention policy without manual per-record deletion.

ttllifecycle-rulespartitioningarchival
TTLs, lifecycle rules and archival pipelines

Privacy and Compliance Architecture

2

minimize → least privilege → audit trail → retention/deletion → encryption → access review

The six controls a privacy-conscious data architecture applies together, each closing a different part of the exposure risk.

privacyleast-privilegeaudit-trailaccess-review
Data minimization, least privilege and audit trails

erasure request → primary + replicas + index + cache + crypto-shred backups + confirm no raw export — within the legal deadline

What a genuine GDPR-style deletion has to reach, and how regional residency and retention minimums layer on top.

gdprdata-residencycrypto-shreddingcompliance
GDPR-style deletion and regional residency

Dependency Management

2

critical = primary function cannot complete without it, no fallback · optional = degrades gracefully, has a fallback

How to classify each edge in a dependency map, and why the code itself does not make this decision for you.

dependency-mappingcritical-pathgraceful-degradation
Building a dependency map: critical vs optional

critical → timeout + bulkhead + circuit breaker (contain, fail visibly) · optional → fallback or async decoupling (hide the failure)

Which of the five standard defensive mechanisms to apply to a dependency, based on whether it is critical or optional.

bulkheadcircuit-breakerfallbackasync-decoupling
Preventing cascading failures at the dependency edge

Failure Mode Analysis

2

times out · returns invalid data · goes down · duplicates work · becomes slow · loses data · becomes unreachable

The seven distinct failure-mode questions to ask about every component in a design.

failure-mode-analysisreliabilitydesign-review
The seven-question failure-mode checklist

total failure = all fail the same way · partial failure = some succeed, some do not — needs its own explicit design

Why partial failure (some replicas/items/steps failing while others succeed) needs different handling than total failure.

partial-failurebatch-processingreliability
Designing for partial failure, not just total failure

Cascading Failures

2

retry storm · shared resource exhaustion · overloaded database · queue backlog · synchronized clients

The five most common amplification mechanisms behind a cascading failure.

cascading-failuresretry-stormresource-exhaustionthundering-herd
Common causes of cascading failure

bounded retries + jitter + circuit breakers + admission control + backpressure + load shedding + bulkheads

The seven standard mitigations against cascading failure, each targeting one or more of its common causes.

cascading-failurescircuit-breakerbulkheadload-shedding
Mitigating cascading failures

Graceful Degradation

2

optional dependency fails → a pre-built, tested fallback engages, not an unhandled error

Why a degraded mode has to be deliberately designed, coded, and tested — classification alone changes nothing.

graceful-degradationfallbackresilience
Defining a degraded mode, deliberately

stale cache · disable the feature · queue the work · partial results

Four recurring patterns for graceful degradation, and the situation each one actually fits.

graceful-degradationstale-cachepartial-results
Four patterns of graceful degradation

Load Shedding

2

reject the excess fast and cheaply → the accepted fraction stays healthy; accept everything → throughput often collapses toward zero

Why deliberately rejecting work under overload usually produces more total successful throughput than accepting everything.

load-sheddingoverloadadmission-control
Load shedding: rejecting work on purpose

priorities (what to shed) + quotas (per-caller cap) + admission control (accept/reject point) + bounded queues (cheap overload signal)

The four composing mechanisms that turn "shed load" into a concrete, fair, and cheap-to-enforce policy.

load-sheddingquotasadmission-controlpriority
Priorities, quotas, admission control and bounded queues

Rate of Change and Schema Evolution

4

additive change → no version bump · breaking change → new version + deprecation window before retiring the old one

When a version bump is needed, and why a deprecation window is what actually makes a breaking change safe.

api-versioningschema-evolutionbackward-compatibility
Versioning APIs and events carefully

expand (add new, keep old) → migrate (dual-write, backfill, roll out) → contract (remove old, only after verified zero-use)

The expand-contract pattern for making a breaking database change safe during a rolling deployment.

schema-migrationexpand-contractrolling-deployment
Backward-compatible database changes

old + new instances coexist for the whole rollout → every change must work in all four old/new interaction combinations

Why a rolling deployment requires designing for old and new versions actively interacting, not just for the final all-new state.

rolling-deploymentbackward-compatibilityzero-downtime-deploy
Rolling deployments: designing for coexisting versions

backward compat = new schema reads old data · forward compat = old schema reads new data — additive changes with defaults preserve both

The two independent compatibility properties event schema evolution has to preserve, and why replay makes backward compatibility strict.

schema-evolutionevent-drivenbackward-compatibilityforward-compatibility
Event schema evolution and consumer compatibility

Event Ordering and Duplicate Handling

3

global ordering = one sequence, expensive coordination · partition-level ordering = strict order per key, no cross-key guarantee

Why most systems guarantee ordering only within a partition/key, and why that matches most real per-entity ordering needs.

event-orderingpartitioningkafka
Why global ordering is expensive

timestamp (clock-dependent) · sequence number (clock-independent counter) · version check (compare before applying)

Three mechanisms for determining true event order, and why sequence numbers and version checks are usually preferred over raw timestamps.

event-orderingoptimistic-concurrencysequence-numbers
Timestamps, sequence numbers and version checks

Distributed Time and Clocks

3

wall clock can step backward (NTP) · two machines' clocks drift apart continuously — neither is a rare fault

Why real clocks are neither monotonic nor identical across machines, and what that breaks when code assumes otherwise.

local timestamps across machines are unreliable for close-together events — use a sequence number, version check, or logical clock instead

Why cross-machine timestamp comparison fails silently for events close together in time, and what to use instead.

clock-driftevent-orderinglogical-clocks
Do not rely on local timestamps for global ordering

UTC (no timezone ambiguity) · monotonic clock (duration) · logical clock (causal order) · timeout (bound an indefinite wait)

Four distinct tools for four distinct time-and-ordering problems in a distributed system.

utcmonotonic-clocklogical-clocklamport-timestamptimeout
UTC, monotonic clocks and logical ordering

Data Consistency in User Workflows

2

constraint > transaction > lock > idempotency key > workflow — take the strongest rung the invariant fits

The five enforcement mechanisms, what each guarantees, and the rule for choosing between them.

invariantsconstraintsidempotencysagas
Choosing an enforcement mechanism per invariant

Payment System Design

3

Notification System Design

2

intent = channel-independent fact, written in the business transaction · delivery = one channel attempt, retried

Why the decision to notify and the attempt to reach someone are two records with two lifecycles.

queue · per-attempt state (sent ≠ delivered) · backoff on transient only · dedupe on intent+channel · prefs and provider limits at send time

The five things the delivery half of a notification system has to do, and the order to do them in.

URL Shortener Design

1

Social Feed Design

2

write-time join = fast reads, O(followers) writes · read-time join = fast writes, O(following) reads · hybrid at a follower threshold

The two fan-out strategies, the celebrity skew that breaks both pure forms, and the hybrid that resolves it.

cache per-user pages + hot timelines · retrieve then rank a bounded candidate set · cursor pagination always · materialization is a dial

The four read-path decisions in a feed, and the two signals — skew and read/write ratio — that set them.

Chat System Design

1

File Storage System Design

1

metadata service (queryable) + object storage (bytes) · pending → signed URL → storage event → scan → available · lifecycle rules for cost

How a file-storage product composes a metadata service, direct signed-URL uploads and an asynchronous post-upload pipeline.

Search System Design

2

lag is inherent · reindex = build alongside + alias flip · shard count is fixed for life · hot terms = hot partitions

The six recurring operational facts of running a search index, all following from the index being a rebuildable derived copy.

Rate Limiter Design

2

identity · scope · algorithm · storage · coordination · failure mode (fail open vs fail closed, per limit)

The six decisions a rate limiter design has to make, with the weight on the failure mode that is usually left implicit.

one atomic op (INCR or script, expiry in the same step) · edge for capacity, app for identity-aware rules

Why a limiter check must be indivisible, and why the layer it runs at decides whether it protects capacity or only fairness.

Job Scheduling System Design

1

Unique ID Generation

2

auto-increment (db-assigned, guessable) · UUIDv4 (free, unordered) · ULID/UUIDv7 (free, time-ordered) · Snowflake (8 bytes, machine id required)

The four id schemes and the coordination cost that distinguishes them.

Feed and Timeline Storage

1

entry = {post id, score, author id} · bounded length + query fallback · hot keys replicated · edit/delete/unfollow/block invalidate differently

The storage layer under a feed: what a timeline entry holds, why it is bounded, and what each invalidation event costs.

Ticketing / Reservation Systems

1

unique constraint on the unit · atomic hold + expires_at checked at read time · idempotency key · convert inside a re-checking transaction

The reservation design that keeps "sold at most once" true under contention, abandonment, retries and slow payments.

Distributed Counters

2

ceiling = 1 / lock hold time · unaffected by more servers · non-linear approach · blocked transactions consume connections

Why a single counter row has a hard write ceiling, and why the failure spreads beyond the counter.

Analytics Systems

2

few rows × all columns (operational) vs many rows × few columns (analytical) — same memory, same disk, opposite patterns

The structural reason large analytical scans do not belong on the database serving your application.

immutable events → buffered collection → streaming and/or batch → columnar lake + warehouse → rollups (keep the raw)

The four parts of an analytics pipeline, and why pre-aggregation and raw retention are complements rather than alternatives.

Data Warehouse vs Operational Database

3

few long queries · many rows × few columns · aggregates · columnar, bulk-append, parallel, denormalised

What the OLAP workload is, and which engineering choices follow from its shape.

estimate first · primary (small only) → replica (fixes contention, not scan cost) → warehouse · always: read-only role, own pool, statement timeout

Why a read-only report can degrade a healthy primary for longer than it runs, and the ladder of places to move it.

Search vs Database

3

structured filtering + transactional reads → database · B-tree, composite, inverted, trigram, partial, built-in full-text

The positive case for a database index, and the index types that cover more than people assume.

indexesb-treefull-textfiltering
When a database index is the right tool

relevance · fuzziness · faceting · blended ranking — against a second system, a sync pipeline, derived-data discipline and reindex-only schema changes

The four capabilities a search engine buys and the four costs it charges, stated so the decision is explicit.

one system of record · no dual writes — outbox or CDC · derived stores answer "which items", the source answers "what is true"

How copies of the same fact stay in step, and which reads may never be served from a derived store.

System Design Interview Process

2

requirements → estimates → APIs → data model → architecture → bottlenecks → deep dive → failures → observability/security → summary

The ten-step sequence as a dependency chain, where each step supplies an input the next one needs.

High-Level Design vs Low-Level Design

3

components · owned stores · queues · network and trust boundaries · 2–3 major flows · sync vs async edges

The vocabulary of a high-level design, and the test for whether you have stayed at the right level.

one component: modules · classes and interfaces · schema (keys, indexes, constraints) · state machines · algorithms · internal APIs

The vocabulary of a low-level design, and the implementability test that marks it finished.

lldschemastate-machinesmodules
What belongs in a low-level design

descend deliberately and announce it · one level per artefact · check high→low completeness and low→high dependency visibility

How to move between system context and detailed design without producing a document that fails at both.

abstractionhldllddesign-review
Moving between levels without mixing them

High-Level Design Checklist

1

requirements · constraints · capacity | clients · APIs | services · stores · cache · queues | external deps · deployment | observability · security · failure · scaling

The fifteen-item high-level checklist, grouped, with the three answers each item may receive.

checklistdesign-reviewobservability
The fifteen-item high-level design checklist

Low-Level Design Checklist

1

entities · interfaces · responsibilities | state machine · schema · indexes | errors · concurrency · retries | module boundaries · testability

The eleven-item low-level checklist, grouped, run against one component after its design exists.

checklistdesign-reviewlow-level-design
The eleven-item low-level design checklist

Trade-Off Analysis

2

BENEFIT (with a number) · COST (concrete) · ALTERNATIVE (rejected) · REASON (specific to this system)

The four-part form every significant design decision is written in.

trade-offsdecision-recorddesign-review
Benefit, cost, alternative, reason

Postgres↔Dynamo · local↔Redis · sync↔async · monolith↔services · strong↔eventual · fan-out read↔write

The six recurring design axes, each with its default side and the condition that justifies leaving it.

trade-offsdefaultscomparison
Six trade-offs worth having rehearsed

Common System Design Anti-Patterns

1

skipped the thinking · wrong default shape · no failure model · blind in production

The twelve common system-design anti-patterns, grouped into the four questions a design failed to ask.

anti-patternsdesign-reviewfailure-modes
Twelve anti-patterns, in four families

System Design Review Checklist

1

does it do the job · does it survive · does it grow · can we run it

The eleven-question design review, in four passes, asked by someone who did not write the design.

design-reviewchecklistfailure-modes
The eleven review questions

Practical Projects

8

create path (rate limited) · id scheme by property · Redis read-through · 302 + click events on a queue

Project 1: a URL shortener, built as two paths with an explicit ID-scheme decision.

projectcachingid-generation
Project 1 — URL shortener

intent row + delivery row per attempt · pool per channel · dedupe key · 429 = backpressure · preferences at send time

Project 2: a notification platform, built around the intent/delivery split and per-attempt state.

projectqueuesdelivery-tracking
Project 2 — Notification platform

signed PUT → object storage · metadata-only API · lease + extend · stream, never load · deterministic output key

Project 3: a file processing platform where bytes bypass the application tier entirely.

projectobject-storageworkers
Project 3 — File processing platform

TX reserve → charge (outside, idem key) → TX record + outbox → async fulfil · conditional update, never read-then-write

Project 4: an order system where money, inventory and a third party must agree across three transaction boundaries.

projecttransactionsidempotencyoutbox
Project 4 — E-commerce order system

persist → publish · per-room sequence · pub/sub per room · client cursor ?after=seq · presence = TTL key

Project 5: a chat platform, and the one project whose connections are stateful.

projectwebsocketsordering
Project 5 — Chat platform

RLS + scoped repo · tenant in every cache key · tenant in every job payload · isolation then RBAC · one usage counter for quotas and billing

Project 6: a multi-tenant SaaS platform where isolation is enforced structurally on every access path.

projectmulti-tenancyauthorization
Project 6 — Multi-tenant SaaS platform

index is derived · ingest from outbox/CDC · reindex behind an alias · evaluation set for ranking · cache queries not docs

Project 7: a search platform whose index can always be thrown away and rebuilt.

projectsearchreindexing
Project 7 — Search platform

atomic check+update (INCR or script) · token bucket for APIs · identity key ≠ IP · decide fail-open/closed · enforce at the edge too

Project 8: a distributed rate limiter — the smallest project that teaches atomicity properly.

projectrate-limitingatomicity
Project 8 — Distributed rate limiter

What a 5-Year Engineer Should Be Able to Explain

1

sizing and choosing · making reads fast · doing it exactly once · surviving failure

The twelve questions a five-year engineer answers without preparation, grouped, with mechanism-level answers.

Priority Roadmap

3

requirements · capacity · APIs · data modeling · SQL · caching · queues · concurrency · transactions · consistency · availability · reliability · security · observability · scaling · trade-offs

Tier 1: the sixteen topics to master — usable without reference, and correct about the failure mode.

roadmapprioritiesfundamentals
Tier 1 — the sixteen to master

recognise it applies → design with it → know its failure mode · look up config and API

Tier 2: thirteen topics needing strong working knowledge, and the four usually adopted too early.

roadmapprioritiesover-engineering
Tier 2 — strong working knowledge

choose a system that implements it · reason about the guarantee · do not build it

Tier 3: six specialized topics where conceptual depth is the correct target, and why.

roadmapprioritiesdistributed-systems
Tier 3 — conceptual and specialized

Recommended Learning Order

1

say what it must do → build the request path → async and survivable → distribute state → operate and communicate

The twenty-nine-step learning order as five phases, with the four edges that cannot be reordered.

Final Senior-Level Standard

3

"How do I implement this?" — correct when the decisions exist; dangerous when it makes them silently

The implementation question: its scope, and the decisions that escape into code when nobody names them.

seniorityscopedesign-decisions
"How do I implement this feature?"

"What architecture and technology?" — correct as the last question, misleading as the first

The technology question: why its answers are plausible without being derived, and how to tell the direction.

senioritytechnology-choicerequirements
"What architecture and technology should I use?"

requirements · invariants · scale assumptions · failure modes · consistency needs · cost · trade-offs → the simplest design that satisfies them

The senior question: seven inputs, one output, and the filter that keeps the analysis from becoming an elaborate design.