Architecture templates.
50 real system designs composed from named distributed-systems patterns. Every one opens in the editor as a live, editable diagram — components, connections, pattern badges, zones and all.
Product backends 10
Chat that never loses a message
WhatsApp-shaped messaging: a connection registry finds the recipient's gateway, delivery is at-least-once with client-side dedup, and offline users fall back to push.
Checkout that never double-charges
An e-commerce checkout composing idempotency keys, a transactional outbox and a compensating saga so retries can never charge twice.
Flash-sale survival kit
1M shoppers, 10k units: edge caching and token buckets tame the flood, sharded counters kill the hot key, and a leveled queue means the database never meets the crowd.
Food delivery platform
An event-driven delivery backend: orders absorb spikes through a leveling queue, and driver dispatch runs as a scatter-gather auction over geo-partitioned cells.
Notification service
One pipeline for every notification: recipient-list expansion with preferences, priority queues so OTPs beat campaigns, delayed digests, a dedup window and a DLQ.
Ride-hailing dispatch
Real-time rider–driver matching: GPS pings stream through competing consumers into a geospatial index, presence tracks who's really online, and surge pricing closes the loop.
Social news feed
The hybrid feed: fan-out-on-write materializes timelines for normal users, celebrities are merged at read time, and a stampede-protected cache keeps hot feeds cheap.
Ticket booking with seat holds
On-sale day without oversells: a waiting room levels the stampede, seats are held with leases plus fencing tokens, and payment failure releases the hold via saga compensation.
URL shortener at scale
The interview classic, production-grade: k-sorted Snowflake IDs, hash-sharded storage, cache-aside reads with negative caching, and 302s served from the CDN edge.
Video streaming pipeline
Upload → transcode fan-out across renditions → fan-in packaging → origin → multi-CDN delivery with health-scored failover.
Data platforms 8
CDC replication backbone
Log-based change data capture streams every row change out of the OLTP database — feeding search, caches and the warehouse without touching app code.
Clickstream personalization
Behavioral events flow through session windows into a feature store and top-K sketches — recommendations served in milliseconds from state computed in-stream.
E-commerce search platform
CQRS split: the catalog writes to Postgres, CDC feeds the inverted index, and queries fan out to shards with hedging and an ML re-rank stage.
Federated data mesh
Domains own their data as products; a federated query engine joins across them with pushdown; a semantic layer gives everyone one metric vocabulary.
HTAP live dashboards
Dashboards read a columnar analytics replica kept fresh by replication and incremental view maintenance — the OLTP primary never sees a GROUP BY.
Lambda architecture warehouse
A batch layer for accuracy and a speed layer for freshness, merged at query time — with a medallion lake underneath.
Metrics & observability platform
A telemetry funnel with cardinality budgets, sketch-based aggregation (t-digest, HLL), hot/cold storage tiers and rollups — observability that doesn't bankrupt you.
Real-time analytics (Kappa architecture)
One stream, one processor, one serving store — the log is the source of truth, and reprocessing is just replaying it from offset zero.
Distributed-systems classics 6
Chain-replicated object store
Writes flow head → middle → tail, strong reads come from the tail, and CRAQ lets clean replicas serve reads — with high/low water marks tracking commit progress.
Distributed lock service with fencing
Leases, heartbeats and fencing tokens over a consistent core — including the exact scenario where a GC-paused client gets fenced instead of corrupting data.
Dynamo-style key-value store
A leaderless replicated KV store composing consistent hashing, quorum writes, hinted handoff, read-repair and Merkle anti-entropy — the Cassandra/Riak blueprint.
Global multi-leader database
Three regions, each accepting local writes, meshed with async replication — version vectors detect conflicts and the LWW hazard is spelled out on the canvas.
Raft-backed config store (etcd-style)
A five-node Raft consistent core serving linearizable configuration with leases and watch notifications — the etcd/Consul architecture under Kubernetes.
Sharded SQL (Vitess-style)
A query router fans SQL across range shards via a topology service — with scatter-gather reads, 2PC for cross-shard writes, and a live range split in progress.
Collaboration & sync 3
Collaborative document editor
Google-Docs-style co-editing: sequence CRDTs merge concurrent keystrokes, an op-log is the source of truth, and snapshots keep join time flat.
Multiplayer canvas (Figma-style)
Live design-tool multiplayer: delta-CRDT maps per file, a session actor as ordering authority, 60Hz cursor presence, and a compacted changelog.
Offline-first mobile sync
A mobile app that works on the subway: local store as primary, delta sync with cursors, optimistic UI, and conflicts resolved at the client.
Fintech 6
Audit & privacy for a regulated platform
Tamper-evident audit logging, maker-checker approvals, tokenized PII with per-user keys, and right-to-erasure implemented as crypto-shredding.
Card authorization in under 100ms
A latency-budgeted authorization path: cell-based isolation with shuffle sharding, near-caches for account state, and hedged reads — every hop annotated with its share of the 100ms.
Digital wallet on a double-entry ledger
A wallet where every balance is a materialized view over an append-only double-entry journal — money moves effectively-once, and the books always balance.
Payment gateway integration done right
Authorize → capture → settle as an explicit state machine, with idempotent PSP calls, signed webhooks, daily reconciliation and chargebacks as compensating transactions.
Real-time fraud detection pipeline
Streaming velocity features, a champion model with a shadow challenger, a rules fallback for model timeouts, and a human review queue for the gray zone.
Trading venue order book
A deterministic matching engine behind a lock-free ring buffer and a sequencer — event-sourced so that replaying the journal rebuilds the exact book, tick for tick.
Resilience & scale 7
Anatomy of a safe RPC
One call path wearing every stability pattern: timeout, retry budget, circuit breaker, bulkhead, hedged reads, graceful fallback and deadline propagation.
Cell-based architecture
Tenants shuffle-sharded into self-contained cells behind a thin router — a bad deploy or poison tenant takes out one cell, never the fleet.
Disaster recovery tiers
Pilot light, warm standby and hot standby side by side — the same application at three price points of RTO and RPO.
Multi-region active-active SaaS
Two live regions with homed tenants, strict regional isolation on the request path, hub-and-spoke event replication and a witness region for honest failover.
Progressive delivery
Blue-green, canary analysis, a one-box region and feature flags composed into a release path where a bad deploy is a non-event.
Strangler-fig migration
Escaping a monolith without a big-bang rewrite: a routing facade shifts traffic route by route while an anti-corruption layer and backfill keep both worlds consistent.
The retry storm (anti-pattern)
What NOT to build: synchronized retries, an inner timeout longer than the caller's, a shared cache TTL and no jitter — watch one slow database become a full cascade.
Platform & infra 5
API platform — composition, idempotency & webhooks
The two API composition styles (gateway aggregation vs GraphQL federation) side by side, with DataLoader batching against N+1, idempotency keys on writes, and signed webhooks with retry.
Durable workflow — order fulfillment
A Temporal-style durable workflow orchestrating fulfillment: deterministic workflow code, activities with retry policies, durable timers, cancel signals and saga compensation.
Kubernetes microservices reference
A production-shaped Kubernetes stack: gateway + BFF at the edge, mesh sidecars between services, HPA autoscaling, service discovery with outlier ejection, and a GitOps loop as the only write path.
Multi-tenant SaaS data plane
Tenant routing into two isolation tiers — pooled shared-table with row-level security for the many, database-per-tenant silos for the few — with per-tenant quotas keeping neighbors quiet.
Serverless event-driven backbone
An event bridge routing to two styles side by side — choreographed functions reacting to events, and a step-function orchestrator owning a flow — with async request-reply and DLQ routing.
AI systems 4
Agentic AI platform
An agent system with adult supervision: planner and workers, a cross-model critic, guard-railed tool calls, human checkpoints for irreversible actions and deterministic replay.
LLM serving gateway
One gateway for all model traffic: cheap-first routing cascade, fallback models, hedged requests, prefix/KV caching, continuous batching and a hard budget governor.
MLOps: training to serving
The full ML loop: one feature store feeding both training and serving, a model registry with lineage, champion-challenger shadow serving and drift-triggered retraining.
Production RAG platform
Retrieval-augmented generation beyond the demo: hybrid dense+sparse retrieval, a re-rank stage, ACL-aware filtering, a semantic cache and freshness re-indexing.