API Gateway Patterns
The API gateway is a critical piece of infrastructure for many architectures, but it's often implemented poorly.
Real-world system designs focusing on constraints, scale, and failure modes.
The API gateway is a critical piece of infrastructure for many architectures, but it's often implemented poorly.
The CAP theorem is widely misunderstood. Here's what it actually means for your system.
Cloud-native means different things to different people, but these patterns are commonly useful.
When data grows beyond a single database's capacity, partitioning becomes necessary.
Range, hash, directory, and geo sharding compared: how to pick a shard key, handle hotspots and resharding, and live with cross-shard queries.
Published on 2026-06-01
Design a high-throughput API gateway covering routing, authentication, rate limiting, request transformation, resilience and a dynamic control plane.
Published on 2026-06-01
Design an audit log system with tamper-evident storage, guaranteed capture of events, fast search, retention policies and compliance-grade access control.
Published on 2026-06-01
Design a double-entry banking ledger with immutable entries, strict balance invariants, idempotent transfers and auditable reconciliation.
Published on 2026-06-01
Design a global CDN with edge caches, anycast and DNS routing, tiered origin shielding, cache invalidation and DDoS-resilient delivery of web and video.
Published on 2026-06-01
Design a chat system for 500M users with WebSocket gateways, per-conversation ordering, offline delivery, group fan-out and message storage.
Published on 2026-06-01
Design real-time collaborative editing for 50 concurrent editors per document using operational transform or CRDTs, sessions, snapshots and offline sync.
Published on 2026-06-01
Design a moderation pipeline for 100M posts a day combining hash matching, ML classifiers, human review queues, appeals and audit trails.
Published on 2026-06-01
Design a horizontally scaled in-memory cache with consistent hashing, replication, eviction and stampede protection for millions of requests per second.
Published on 2026-06-01
Design a unique ID generator producing time-sortable 64-bit IDs across data centers using Snowflake-style bit layout, clock handling and worker coordination.
Published on 2026-06-01
Design a fault-tolerant distributed job scheduler with leader election, sharded timers, leases, retries and at-least-once execution for millions of jobs a day.
Published on 2026-06-01
Design an S3-style object store with metadata sharding, erasure coding, multipart upload and background repair for exabyte-scale durability.
Published on 2026-06-01
Design a checkout that reserves stock, prices carts, takes payment and creates orders exactly once, even during flash sales and partial failures.
Published on 2026-06-01
Design a feature flag service with fast local evaluation, targeting rules, gradual rollouts, streaming updates and safe behavior when the control plane fails.
Published on 2026-06-01
Design real-time order and courier tracking for food delivery: location ingest, order state machines, live ETA updates and fan-out to millions of clients.
Published on 2026-06-01
Design a hotel reservation system that manages room-night inventory, controls overbooking and keeps channel partners and pricing consistent.
Published on 2026-06-01
Design an inventory management system that tracks stock across warehouses, prevents overselling and reconciles physical counts with the ledger.
Published on 2026-06-01
Design a Dynamo-style key-value store with partitioning, quorum replication, vector clocks, LSM storage and anti-entropy for high availability at scale.
Published on 2026-06-01
Design a centralized logging platform with agents, buffered ingestion, indexing, tiered storage and fast search for terabytes of logs per day.
Published on 2026-06-01
Design a Kafka-style durable message queue with partitioned logs, replication, consumer groups and delivery guarantees for millions of messages per second.
Published on 2026-06-01
Design a time-series metrics platform with collection, compressed storage, downsampling, query engine and alerting for millions of samples per second.
Published on 2026-06-01
Microservices architecture has become the default assumption for many organizations, but the reality is more nuanced.
Design a multi-tenant SaaS platform covering tenant isolation models, noisy-neighbor control, per-tenant scaling, billing metering and safe migrations.
Published on 2026-06-01
Design a social news feed for 300M daily users, comparing fan-out on write and read, hybrid celebrity handling, ranking and cache sizing.
Published on 2026-06-01
Design a multi-channel notification system sending 10B messages a day over push, email, SMS and in-app with preferences, retries and rate limits.
Published on 2026-06-01
Design a presence system showing online, away and offline status for 200M users using heartbeats, TTL stores, pub/sub fan-out and lazy subscriptions.
Published on 2026-06-01
Design a payment gateway that routes charges to acquirers, guarantees idempotency, tokenizes cards and reconciles with banks reliably.
Published on 2026-06-01
Design a photo sharing service for 500M users: direct-to-storage uploads, thumbnail pipeline, CDN delivery, metadata sharding and feed integration.
Published on 2026-06-01
Rate limiting is simple until it isn't. Explore the requirements, design options, and failure modes of building a rate limiter that works at scale.
Published on 2026-02-20
Design a ride-hailing dispatch system with geospatial driver indexing, low-latency matching and safe handling of offers, timeouts and driver churn.
Published on 2026-06-01
Design a typeahead system returning top suggestions in under 100 ms for 5B queries a day using tries, offline aggregation, caching and freshness updates.
Published on 2026-06-01
Design a distributed full-text search engine with inverted indexes, sharding, scatter-gather queries, BM25 ranking and near-real-time indexing.
Published on 2026-06-01
Design a social graph store for 1B users and a friend recommendation pipeline using adjacency lists, sharding, mutual friends and offline candidate ranking.
Published on 2026-06-01
Design a ticket booking platform that prevents double-booked seats, holds inventory during payment and survives on-sale traffic spikes.
Published on 2026-06-01
Design a URL shortener handling 100M new links a month and 10B redirects, covering ID generation, caching, storage and abuse handling.
Published on 2026-06-01
Design a video streaming platform with upload, transcoding to adaptive bitrate ladders, CDN delivery and a metadata service for 200M daily viewers.
Published on 2026-06-01
Design a distributed web crawler fetching 1B pages a month with a URL frontier, politeness, deduplication, robots.txt handling and trap avoidance.
Published on 2026-06-01
Design disaster recovery around RTO and RPO: backup and restore, pilot light, warm standby, and active-active, plus the testing that makes them real.
Published on 2026-06-01
Errors are inevitable. How you track and respond to them matters.
Event-driven architecture (EDA) is powerful but often misunderstood. Here's the reality.
Eventual consistency means: "Given enough time without new updates, all replicas will eventually converge to the same state."
Designing for failure is designing for the reality that things will break.
Idempotency means: "Making the same request multiple times has the same effect as making it once."
Observability is not monitoring. Monitoring is observing known knowns. Observability is discovering unknown unknowns.
Performance budgets prevent feature creep from degrading user experience.
Service meshes provide infrastructure-level observability, but it's different from application-level observability.
Logs are often the first thing engineers reach for when debugging. Poor logging makes debugging a nightmare.