stackbook.io
🔍

System Architectures

Real-world system designs focusing on constraints, scale, and failure modes.

API Gateway Patterns

The API gateway is a critical piece of infrastructure for many architectures, but it's often implemented poorly.

Database Sharding Strategies

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

Designing an API Gateway

Design a high-throughput API gateway covering routing, authentication, rate limiting, request transformation, resilience and a dynamic control plane.

Published on 2026-06-01

Designing an Audit and Event Log System

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

Designing a Banking Ledger

Design a double-entry banking ledger with immutable entries, strict balance invariants, idempotent transfers and auditable reconciliation.

Published on 2026-06-01

Designing a Content Delivery Network

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

Designing a Chat and Messaging System

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

Designing Collaborative Document Editing

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

Designing a Content Moderation Pipeline

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

Designing a Distributed Cache

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

Designing a Distributed ID Generator

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

Designing a Distributed Job Scheduler

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

Designing an E-Commerce Checkout System

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

Designing a Feature Flag Service

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

Designing a Food Delivery Tracking System

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

Designing a Hotel Reservation System

Design a hotel reservation system that manages room-night inventory, controls overbooking and keeps channel partners and pricing consistent.

Published on 2026-06-01

Designing an Inventory Management System

Design an inventory management system that tracks stock across warehouses, prevents overselling and reconciles physical counts with the ledger.

Published on 2026-06-01

Designing a Distributed Key-Value Store

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

Designing a Log Aggregation Platform

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

Designing a Distributed Message Queue

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

Designing a Metrics and Monitoring System

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

Designing a Multi-Tenant SaaS Platform

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

Designing a News Feed and Timeline

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

Designing a Notification System

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

Designing a Payment Gateway

Design a payment gateway that routes charges to acquirers, guarantees idempotency, tokenizes cards and reconciles with banks reliably.

Published on 2026-06-01

Designing a Photo Sharing Service

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

Designing a Distributed Rate Limiter

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

Designing a Ride-Hailing Dispatch System

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

Designing Search Autocomplete and Typeahead

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

Designing a Distributed Search Engine

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

Designing a Ticket Booking System

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

Designing a URL Shortener

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

Designing a Video Streaming Platform

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

Designing a Web Crawler

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

Disaster Recovery Architecture

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

Eventual Consistency Strategies

Eventual consistency means: "Given enough time without new updates, all replicas will eventually converge to the same state."

Idempotency Patterns

Idempotency means: "Making the same request multiple times has the same effect as making it once."

Observability System Design

Observability is not monitoring. Monitoring is observing known knowns. Observability is discovering unknown unknowns.

Service Mesh Observability

Service meshes provide infrastructure-level observability, but it's different from application-level observability.