System Design

System Design

Rate limiters, circuit breakers, sharding, real-system blueprints.

164Articles
164Topics covered
Articles in this category

All 124 articles, sorted alphabetically

PRACTICAL GUIDE

Empty Versus Unset: VAR:-default and VAR-default Across Shells, Compose and Config Loaders

The colon decides whether an empty variable counts as missing. Exact rules for :- and - across POSIX sh, Docker Compose, Kubernetes and Python, with a loader you can test.

Read article
PRACTICAL GUIDE

Property-Based Tests for the Deterministic Rules That Check Agent Proposals

Write properties, not examples, for the rule layer that checks agent proposals: conservation, thresholds, monotonicity and idempotency, with the shrunk counterexample they found.

Read article
PRACTICAL GUIDE

When a Model Call Outlasts the Queue Visibility Timeout: Duplicate Agent Steps, Heartbeats and Redrive

An agent step that outlasts the queue visibility timeout is delivered again and again. Heartbeats, timeout sizing, idempotent effects and when to move the step out of the queue.

Read article
NEW · AGENT-ERA ARCHITECTURE

Give Agent Actions an Undo Window Without Losing Execution Safety

Approving every agent action up front turns people into a queue. Scheduling the action and letting someone cancel it for a short window keeps a person in the loop at lower cost, if cancel and execute cannot both win, the window matches who is watching, and irreversible parts are held back.

Read article →
NEW · AGENT-ERA ARCHITECTURE

Why Concurrent Agent Runs Break Invariants Across Database Rows

Two agent runs each read that a customer has one goodwill credit left and each insert one. Every row-level check passes and the rule is broken. How write skew happens across tool calls, which guards actually stop it, and how to migrate an existing service.

Read article →
NEW · AGENT-ERA ARCHITECTURE

Notification Events or Event-Carried State When an Agent Consumes Domain Events: Callback Load, Stale Reads and Snapshot Versions

What changes when an agent, rather than a service, consumes domain events: why thin notification events turn into bursts of callback reads and race conditions, what event-carried state transfer fixes and costs, and how to version the snapshot an agent acts on.

Read article →
NEW · AGENT-ERA ARCHITECTURE

An Anti-Corruption Layer for Agent Tools Over a Legacy System: Translating Codes, Invariants and Errors Before the Model Sees Them

How to put a translation layer between agent tools and a legacy back office: mapping status codes and units into a clean model, enforcing invariants the old system kept implicit, turning multi-call sequences into one operation, and migrating tool by tool.

Read article →
NEW · AGENT-ERA ARCHITECTURE

Running an Agent Step Inside an Existing Workflow Engine: Callback Tokens, Heartbeats, Timeouts and Late Completions

How to run a long agent step inside an existing workflow as a callback task: heartbeats a stalled model call cannot block, timeouts that close an attempt, retries with new tokens, rejected late completions, side effects keyed to the execution, and when a plain task is enough.

Read article →
NEW · AGENT-ERA ARCHITECTURE

Agents and Lost Updates: Version Checks, Re-Planning on Conflict and Field Merges When Think Time Is Seconds

Why an agent that reads a record, reasons for twenty seconds and writes it back overwrites other people's changes, and how to fix it with version checks at the store, a conflict result the agent can re-plan from, field-level merges, a migration path, and when none of it is needed.

Read article →
NEW · AGENT-ERA ARCHITECTURE

Agents Propose Desired State, a Reconciler Converges: Level-Triggered Control Instead of Agent-Executed Steps

How to let an agent write a desired state and leave the step-by-step execution to a deterministic reconciler: a level-triggered loop that is idempotent and restartable, why this beats an agent that calls each API itself, the migration path, and when a plain workflow is enough.

Read article →
NEW · AGENT-ERA ARCHITECTURE

Agent Traffic on Shared Internal Services: Per-Tenant Fair Queuing, Concurrency Caps and Re-Plan Amplification

Why agent tenants overload shared internal services differently from ordinary callers, why a per-tenant concurrency cap still lets one tenant fill the queue, how per-tenant fair queues protect everyone else, and why the agent runtime needs its own call budget.

Read article →
NEW · AGENT-ERA ARCHITECTURE

Putting an Agent Step Inside an Existing Event Consumer: Per-Key Ordering, Model Rate Limits, Poison Events and Effects That Survive Redelivery

How to add an agent decision to a partitioned event consumer that already works: keep per-key order, treat 429s as backpressure on one partition, park poison events with their key, and make effects idempotent so redelivery after a crash applies nothing twice.

Read article →
NEW · AGENT-ERA ARCHITECTURE

Strangler-Fig Migration to an Agent-Backed Path: A Routing Facade, Shadow Parity, Segment-by-Segment Cutover and Keeping the Old Code Callable

How to introduce an agent into an existing request path without a big-bang replacement: a routing facade owns the decision, the agent runs in shadow on read-only inputs, disagreements are classified, segments cut over one at a time with rollback, and the old code remains the fallback.

Read article →
NEW · CORE ENGINEERING

Cache Stampedes: Request Coalescing, Probabilistic Early Expiration, Stale-While-Revalidate and Choosing Between Them

When a hot cache entry expires, every miss recomputes it at once. The three defences compared with code: request coalescing, the XFetch probabilistic early expiration rule from the 2015 VLDB paper, and stale-while-revalidate as RFC 5861 and nginx define it.

Read article →
NEW · AGENT-ERA ARCHITECTURE

Agent Tool Effects Through a Transactional Outbox: One Transaction for the Step Journal and the Side Effect, an At-Least-Once Relay and Resume After a Crash

How an agent runtime should record what a tool did: the step journal row, the business effect and the outbox row commit together, a relay publishes at least once, consumers deduplicate by outbox id, and a crashed run resumes from the journal instead of repeating the effect.

Read article →
NEW · AGENT-ERA ARCHITECTURE

From Autonomous Loop to Explicit State Machine: Mining States From Agent Traces, Guards, Budgets and the Transitions a Model May Choose

A migration method for agent systems that began as an autonomous tool loop: extract candidate states from recorded traces, make guards and budgets deterministic, let the model choose only among allowed transitions, and decide when the loop was fine as it was.

Read article →
NEW · AGENT-ERA ARCHITECTURE

Making an Existing API Safe for Agent Callers: Previews, Idempotency Keys, Error Contracts and Budgets

What a service owner should change when AI agents start calling an existing HTTP API: preview endpoints, required idempotency keys, machine-actionable errors, bounded responses, per-principal budgets and contract tests.

Read article →
ARTICLE · 001

System Design: Rate Limiting

A comprehensive guide to rate limiting: token bucket mechanics, distributed Redis-backed implementations, sliding window and leaky bucket algorithms, …

Read article →
ARTICLE · 002

Load Balancing Algorithms: Round Robin to Consistent Hashing - AICassindra

Load balancing for system design: round robin, least connections, IP hash and consistent hashing, Layer 4 vs Layer 7, health checks, sticky sessions, …

Read article →
Bookstore price recommendations and constraints
ARTICLE · 003

Alipay Super-App Architecture, in depth: LDC unitization, RZone, GZone and CZone, cross-unit payments and unit-level failover

How Alipay scales by unitization: why sharding alone is not enough, the LDC zone model with RZones, a single GZone and per-city CZone mirrors, routing…

Read article →
ARTICLE · 004

Amazon Shopping Cart Architecture, in depth: the always-writable cart, replication and merge semantics, guest carts, price revalidation and the checkout handoff

How to design an Amazon-scale shopping cart from first principles: why the cart must accept writes during failures, what the public Dynamo paper says …

Read article →
ARTICLE · 005

API Versioning Strategies, in depth: carriers, major versus dated versions, and serving every version from one codebase

How to run many API versions at once without forking your code: what a version protects, URL, header, media type and account-pin carriers, major versu…

Read article →
ARTICLE · 006

ATM End-to-End Architecture, in depth: terminal, PIN security, ISO 8583 authorization, reversals and the cash you cannot un-dispense

How an ATM cash withdrawal works end to end: the terminal device layer, PIN blocks and key hierarchy with HSM translation, ISO 8583 financial and reve…

Read article →
ARTICLE · 007

Autocomplete / Typeahead Architecture, in depth: top-k tries, decayed popularity, trending deltas and the per-keystroke latency budget

How to build a search typeahead that answers every keystroke in tens of milliseconds: requirements and sizing, a trie that caches the top-k completion…

Read article →
ARTICLE · 008

Cache Invalidation Strategies, in depth: Staleness Budgets, CDC Pipelines and Purges

Cache invalidation as a delivery system: staleness budgets, strategy comparison, a CDC-driven invalidator with code, generation counters and CDN tag p…

Read article →
ARTICLE · 009

CQRS + Event Sourcing Architecture, in depth: building it on PostgreSQL

Building CQRS with event sourcing on one PostgreSQL database: the events table and optimistic concurrency, command handlers, the commit-order gap that…

Read article →
ARTICLE · 010

Credit Card Payment Flow Architecture, in depth: the four-party model, authorisation, clearing and settlement, tokens and 3-D Secure, and a merchant service that survives timeouts

How a card payment really flows: issuer, acquirer, network and PSP roles, ISO 8583 authorisation and holds, capture, clearing, settlement and intercha…

Read article →
ARTICLE · 011

Database Sharding Architecture, in depth: the shard map, the routing tier and live resharding

The machinery around a sharded database: mapping keys to keyspace ids and shards, where the router lives, versioned shard maps and stale-route protect…

Read article →
ARTICLE · 012

Designing a Real-Time Chat System (1M concurrent users)

End-to-end architecture for a WhatsApp-scale chat system, from connection layer to message storage.

Read article →
ARTICLE · 013

Designing an Event-Driven Order System, in depth: state machine, event contracts, reservations, payments and failure walk-throughs

An end-to-end design for an event-driven e-commerce order system: the order state machine, event envelopes, per-order ordering by key, inventory reser…

Read article →
ARTICLE · 014

Designing a Feature Flag System, in depth: requirements, data model, evaluation semantics, propagation and failure modes

A system design walk-through of a feature flag platform: requirements and capacity estimates, the flag data model and versioning, a precise evaluation…

Read article →
ARTICLE · 015

Designing a File Upload Service (S3-style)

Designing an upload service: control plane versus data plane, multipart and resumable uploads, integrity checks, content-addressed dedup, and lifecycl…

Read article →
ARTICLE · 016

Designing a Metrics Aggregation System

Designing a metrics platform: series cardinality, push versus pull ingest, sharding by series, the TSDB write path, rollups, and per-tenant limits.

Read article →
ARTICLE · 017

Designing a Payment System, in depth: a marketplace pay-in and pay-out design from requirements to reconciliation

An end-to-end payment system design for a marketplace: requirements and capacity, the data model, a guarded payment state machine, safe PSP calls, pay…

Read article →
ARTICLE · 018

Designing a Quota System, in depth: allocation, rate and budget quotas, tenant hierarchies, leases and reconciliation

How to design a multi-tenant quota system: the difference between rate limits and quotas, the tenant hierarchy and data model, transactional reservati…

Read article →
ARTICLE · 019

Designing Search at Scale, in depth: sizing shards and replicas, taming fan-out tail latency, fresh indexing and zero-downtime reindexing

How to take a search system from one cluster to production scale: the three independent scale axes, sizing shards from measured bytes per document, si…

Read article →
Bookstore order workflow and recovery
ARTICLE · 020

Directory-Based Sharding, in depth: entry granularity, the directory data model, cached resolution with epochs, moving one tenant and isolating hot tenants

Directory-based sharding from first principles: how it compares with hash and range sharding, choosing per-key, per-tenant or virtual-bucket entries, …

Read article →
ARTICLE · 021

Discord Architecture, in depth: the gateway, Elixir guild processes, ScyllaDB message storage and the voice SFU

How Discord delivers real-time text and voice at scale: the gateway WebSocket protocol and sharding, Elixir session and guild processes and their fan-…

Read article →
ARTICLE · 022

DoorDash Architecture, in depth: from a Django monolith to Kotlin services, Cadence fallbacks and DeepRed dispatch

DoorDash food delivery architecture: what DoorDash published about its Python monolith to Kotlin gRPC migration, the checkout service on Cassandra, Ka…

Read article →
ARTICLE · 023

Dropbox File Sync Architecture, in depth: block hashing, the journal and cursors, the three-tree client and conflict handling

How a Dropbox-style file sync system works end to end: splitting files into 4 MiB blocks with SHA-256 content hashes, committing metadata only after b…

Read article →
ARTICLE · 024

Elasticsearch Cluster Architecture, in depth: node roles, master election and voting, cluster state, shard allocation, replication and recovery

How an Elasticsearch cluster is built and kept consistent: node roles and topology, discovery and the voting configuration, cluster-state publication,…

Read article →
ARTICLE · 025

Email Delivery Architecture, in depth: SMTP relay, SPF, DKIM and DMARC alignment, retry queues, bounces, and staying out of the spam folder

How a production email sending system works end to end: submission and relay over SMTP, envelope versus header sender, SPF, DKIM and DMARC with alignm…

Read article →
ARTICLE · 026

Event-Driven Microservices Architecture, in depth

Event-driven microservices architecture at estate scale: a reference architecture, topic ownership and naming, CloudEvents envelopes and schema compat…

Read article →
ARTICLE · 027

Facebook Messenger Architecture, in depth: Iris ordered queues, snapshot-plus-delta sync over MQTT, the MyRocks migration and what default encryption changed

How Facebook Messenger is built, from Meta's own engineering accounts: Iris as an ordered update queue with per-consumer pointers and storage tie…

Read article →
ARTICLE · 028

Real-Time Fraud Detection System Architecture, in depth: the synchronous decision path, streaming features, rules plus models, delayed labels and failing safely

How to design a real-time fraud detection system for payments: the authorisation-time decision path and its latency budget, online features in three f…

Read article →
ARTICLE · 029

Geo-Partitioning, in depth: data residency, home-region keys, cells versus row-level placement, leak audits and re-homing

Geo-partitioning for data residency explained: residency versus latency, choosing the home-region key, region cells versus row-level placement, Cockro…

Read article →
ARTICLE · 030

Google Drive + Docs Real-Time Collaboration Architecture, in depth: the ordering point, the op log, sessions, permissions and offline edits

A first-principles reference architecture for Google Docs-style real-time collaboration on top of a Drive-style file service: central-server operation…

Read article →
ARTICLE · 031

Google Maps Real-Time Traffic Architecture, in depth: probe ingestion, map matching, segment speeds, supersegment ETA models and live routing

How a real-time traffic system like Google Maps turns anonymous phone location into segment speeds, live route weights and ETAs: probe ingestion and p…

Read article →
ARTICLE · 032

Google Search Architecture, in depth: crawling, rendering, incremental indexing, sharded serving, tail latency and the ranking cascade

What Google has actually published about its search architecture: crawl budget and politeness, deferred rendering, Percolator's incremental index…

Read article →
Bookstore order workflow and recovery
ARTICLE · 033

GraphQL Architecture, in depth: execution, batching, cost limits, persisted queries and federation

How a GraphQL server really works: parse, validate and execute, null propagation, N+1 and DataLoader batching, static query cost limits, trusted docum…

Read article →
ARTICLE · 034

gRPC + Protobuf Architecture, in depth: the contract layer, wire encoding by hand, presence, breaking-change checks, field masks, rich errors and codegen

The Protobuf contract layer of a gRPC system: a message encoded byte by byte, field presence, compatibility rules enforced in CI with buf, package ver…

Read article →
ARTICLE · 035

Hash Sharding, in depth

Hash sharding in depth: choosing a stable hash, why hash mod N moves most data on resize, fixed logical slots and slot maps, jump consistent hash, sha…

Read article →
ARTICLE · 036

iCloud Sync Architecture, in depth: CloudKit zones, change tokens, conflicts and CKSyncEngine

How app data syncs through iCloud with CloudKit: containers, databases and record zones, delta sync with change tokens, silent push, optimistic concur…

Read article →
ARTICLE · 037

iMessage Architecture, in depth: the IDS key directory, APNs delivery, per-device fan-out, PQ3 and attachments

How Apple's iMessage is structured, from Apple's published security documentation: device registration with the identity directory, per-devi…

Read article →
ARTICLE · 038

Instagram Feed Generation Architecture, in depth: per-surface ranking, blending followed, suggested and ad content, and stable media-heavy pages

A reference architecture for an Instagram-style feed: separate pipelines per surface, unseen followed inventory with an adaptive lookback, suggested a…

Read article →
ARTICLE · 039

Kafka Partition Architecture, in depth: segments and indexes on disk, high watermarks, replica placement, sizing partition counts and reassignment

What a Kafka partition physically is and how to design around it: segment, offset-index and time-index files, retention and compaction per segment, lo…

Read article →
ARTICLE · 040

LinkedIn Architecture, in depth: the professional graph, the log at the centre, and derived data stores built from one source of truth

How LinkedIn's architecture is shaped by network distance and derived data: Espresso as source of truth, change capture into Kafka, Samza and bat…

Read article →
ARTICLE · 041

Meta Threads Architecture

How Meta launched Threads in 5 days by leveraging Instagram's infrastructure. Covers authentication reuse, social graph leverage, database shardi…

Read article →
ARTICLE · 042

PayPal P2P Architecture, in depth: a reference design for wallet-to-wallet money transfer

How a PayPal-style person-to-person payment system can work: what PayPal has and has not published, requirements, a double-entry ledger, an idempotent…

Read article →
ARTICLE · 043

Range Sharding, in depth: the sorted range map, scans across boundaries, size and load splits, merges, monotonic-key hotspots and stale routing

How range sharding works and how to operate it: range descriptors and bisect routing code, scans that survive splits, size-based versus load-based spl…

Read article →
ARTICLE · 044

Rate Limiter Architecture, in depth: GCRA in one Redis key, composite limits, local token leasing, failure policy and client signalling

How to build a production rate limiter rather than pick an algorithm: the decision contract, GCRA implemented as an atomic Redis script with server ti…

Read article →
ARTICLE · 045

Recommendation System Architecture, Netflix-style, in depth: rows of rows, page construction, offline/nearline/online tiers, artwork bandits and fallbacks

How a streaming homepage is personalized as a whole page: generating candidate rows, ranking titles within rows, building a page with deduplication an…

Read article →
ARTICLE · 046

Reddit Architecture, in depth: hot, best and controversial ranking, precomputed listings, the asynchronous vote path and comment trees

How Reddit's classic architecture serves sorted listings at scale, reconstructed from the open-source r2 code: the Thing data model, the exact ho…

Read article →
ARTICLE · 047

REST API Design, in depth: HTTP method semantics, status codes, caching and validators, conditional writes, PATCH formats and long-running operations

REST API design at the HTTP layer: what safe, idempotent and cacheable methods promise to clients, caches and gateways; status codes clients can branc…

Read article →
ARTICLE · 048

Robinhood Trading Architecture, in depth: a reference design for a retail broker, from the tap to settlement, and what the 2020 and 2021 incidents teach

A system design for a commission-free retail brokerage like Robinhood: order intake and idempotency, buying-power reservation, an order state machine,…

Read article →
ARTICLE · 049

Amazon S3 Object Storage Internals, in depth: erasure-coding geometry, a worked durability model, end-to-end checksums, the storage node and the consistency witness

How an S3-scale object store keeps data: erasure-coding geometry against repair bandwidth, a durability model computed in code, correlated failures an…

Read article →
ARTICLE · 050

Backpressure Architecture in Depth: Bounded Queues, Credit-Based Flow Control and Propagating Overload Upstream

How backpressure keeps systems stable when producers outrun consumers: bounded queues and Little's Law sizing, blocking versus credit signals ver…

Read article →
ARTICLE · 051

Content Delivery Network Architecture in Depth

A 2500-word walkthrough of CDN architecture: client, edge PoP, origin shield, origin, cache rules, purge, optimization, TLS, edge compute, analytics, …

Read article →
ARTICLE · 052

CQRS architecture

Deep-dive on CQRS (Command Query Responsibility Segregation): splitting the write model that validates commands and mutates a normalized source of tru…

Read article →
ARTICLE · 053

Dead Letter Queue (DLQ): Retry Policy, Alarms and Safe Redrive

What a dead letter queue (DLQ) is and how to run one: delivery count and retry policy, broker vs app DLQs, failure metadata, depth alarms, safe redriv…

Read article →
ARTICLE · 054

Event sourcing architecture

Deep-dive on event sourcing: commands and aggregates that emit events, the append-only event store as source of truth, rehydrating state by replay, sn…

Read article →
ARTICLE · 055

Geo-distributed systems -- serving the world with low latency

Deep-dive on geo-distributed systems: the latency/availability/law drivers, multi-region replicas, data placement, the speed-of-light consistency-vs-l…

Read article →
ARTICLE · 056

Gossip Protocol Explained: Rumor Spreading vs Anti-Entropy

How a gossip protocol works: the SYN/ACK/ACK2 digest exchange, rumor spreading vs anti-entropy, phi-accrual failure detection, seed nodes and split br…

Read article →
ARTICLE · 057

Hot-key mitigation architecture

Deep-dive on surviving hot keys in sharded systems: why hashing concentrates load, approximate hotspot detection, edge caching for read-hot keys, key …

Read article →
ARTICLE · 058

Idempotency architecture

Deep-dive on idempotency architecture: keys, dedupe store, retry policy, conflict handling, cross-service propagation, TTL, and audit.

Read article →
ARTICLE · 059

Leader election architecture

Deep-dive on leader election: quorum-based campaigning, terms/epochs, leases and heartbeats for bounded failover, fencing tokens that neutralize a sta…

Read article →
ARTICLE · 060

Load shedding -- dropping work to survive overload

Deep-dive on load shedding: the overload-collapse problem, rejecting excess load, serve-some-well-rather-than-all-badly, fail fast (early rejection), …

Read article →
ARTICLE · 061

Notification System Architecture in Depth: fan-out, per-recipient decisions, channel adapters and feedback

Design a notification system: delivery guarantees and priority classes, outbox to fan-out to orchestrator, data model, decision code with quiet hours …

Read article →
ARTICLE · 062

Transactional Outbox: Polling Relay vs Debezium CDC

How a transactional outbox publishes events reliably: outbox table in the same DB transaction, polling relay vs Debezium CDC, at-least-once delivery, …

Read article →
ARTICLE · 063

Pub/sub system design architecture

Deep-dive on pub/sub design: topics, partitions, consumers, delivery guarantees, retention, DLQ, schema registry, and metrics.

Read article →
ARTICLE · 064

Distributed Rate Limiter Architecture in Depth

Distributed rate limiting as a coordination problem: central counters, static splits, periodic sync and token leasing compared with error bounds, Redi…

Read article →
ARTICLE · 065

Rate limiting architecture, in depth: rate versus concurrency limits, adaptive limits and outbound throttling

Rate limiting as admission control: where to place rate and concurrency limits, sizing from load tests, AIMD and gradient adaptive limits, client-side…

Read article →
ARTICLE · 066

Read-replica routing architecture

Deep-dive on routing reads to replicas safely: read classification, LSN/GTID write watermarks, session stores, byte vs time lag, replica ejection, pri…

Read article →
ARTICLE · 067

Saga pattern architecture

Deep-dive on the saga pattern: orchestration vs choreography, the durable saga log, compensating transactions and pivot placement, idempotency keys an…

Read article →
ARTICLE · 068

Scaling Patterns in Depth: Finding the Bottleneck, Doing the Capacity Math, and Choosing the Next Move

A bottleneck-first method for scaling a system: name the saturated resource, size it with Little's law and queueing arithmetic, use the Universal…

Read article →
ARTICLE · 069

Search System Architecture in Depth

A 2500-word walkthrough of search architecture: docs, indexer, inverted index, query, hybrid retrieval, reranking, personalization, analytics, shardin…

Read article →
ARTICLE · 070

Service discovery architecture

Deep-dive on service discovery: the health-checked registry, client-side vs server-side discovery, DNS and mesh-sidecar packagings, watches and cachin…

Read article →
ARTICLE · 071

Database Sharding: Shard Keys, Range vs Hash, Rebalancing

How database sharding works: choosing a shard key, range vs hash partitioning, routing and shard directories, online rebalancing, cross-shard queries,…

Read article →
ARTICLE · 072

Service Mesh Architecture, in depth: how sidecar proxies intercept traffic, get their configuration and identity, what they cost and how they fail

How a sidecar service mesh actually works: injection, iptables redirection, xDS configuration from the control plane, SPIFFE identities and mTLS, one …

Read article →
ARTICLE · 073

Shard Rebalancing Strategies, in depth

Shard rebalancing in depth: what to balance, fixed partitions versus split-merge versus consistent hashing, triggers with hysteresis, a greedy move pl…

Read article →
ARTICLE · 074

Signal Protocol Architecture, in depth: PQXDH key agreement, the Double Ratchet, and a server that learns almost nothing

How the Signal Protocol delivers end-to-end encryption to devices that are usually offline: the system architecture and what the server stores, identi…

Read article →
ARTICLE · 075

Slack Architecture, in depth: channels and threads, channel and gateway servers, Vitess sharding by channel, and the Flannel edge cache

How Slack delivers channel and thread messages, from Slack's published engineering accounts: the conversation and thread data model, channel, gat…

Read article →
ARTICLE · 076

Snapchat Ephemeral Messaging Architecture, in depth: view state, expiry, crypto-shredding and the leaks that defeat deletion

A system design for Snapchat-style ephemeral messaging: what disappearing messages can and cannot promise, a data model with per-recipient view state,…

Read article →
ARTICLE · 077

Spotify Music Streaming Architecture, in depth

Designing a Spotify-style music service: quality tiers and track sizes, ingest, the playback path with prefetch, multi-CDN delivery, offline keys, rev…

Read article →
ARTICLE · 078

Stock Exchange Matching Engine Architecture, in depth

How an exchange matching engine works: price-time priority, order book layout, the matching loop, order types, sequencer and journal, replication, mar…

Read article →
ARTICLE · 079

Stripe Payment Platform Architecture, in depth: PaymentIntents, idempotency keys, signed webhooks, API versioning and the ledger behind them

How Stripe's payment platform is built as seen from both sides: the PaymentIntent state machine, idempotency as an API primitive, signed and retr…

Read article →
ARTICLE · 080

Backend for Frontend (BFF), in depth: per-client backends, aggregation, token handling and when not to build one

The Backend for Frontend pattern from first principles: why one general-purpose API serves many clients badly, how a BFF differs from an API gateway a…

Read article →
ARTICLE · 081

Caching

An orienting map of caching: the tiers a byte can live in, cache-aside versus write-through, why invalidation deletes rather than updates, the fill ra…

Read article →
ARTICLE · 082

Event-Driven Architecture, in depth: events versus commands, the four styles, producer and consumer contracts, ordering, evolution and when not to use it

A decision framework for event-driven architecture: what an event is and is not, notification versus event-carried state transfer versus event sourcin…

Read article →
ARTICLE · 083

API Gateway Pattern, in depth: when to add one, topologies, request composition under deadlines, identity propagation and versioning

The API gateway pattern from first principles: the client-to-microservice problem it solves, what belongs in a gateway and what does not, single gatew…

Read article →
ARTICLE · 084

Leader-Follower Replication, in depth: the replicated log, high watermarks, epochs, follower truncation and the read contract

How leader-follower replication works as a replicated log: log end offsets and the high watermark, acknowledgement policies, a running failover simula…

Read article →
ARTICLE · 085

L4 vs L7 Load Balancing: Algorithms and Health Checks

L4 vs L7 load balancers: what each layer can see, round robin vs least connections, power of two choices, consistent hashing, health checks, draining,…

Read article →
ARTICLE · 086

Message Queues

The main message queue types (log-based Kafka vs broker-based RabbitMQ vs managed SQS), semantics (at-least-once vs at-most-once vs exactly-once), and…

Read article →
ARTICLE · 087

Microservices Architecture, in depth: service boundaries, data ownership, synchronous versus asynchronous calls, failure arithmetic, a worked checkout and when a modular monolith wins

Microservices from first principles: what makes a service independent, drawing boundaries around data ownership, choosing synchronous or event-driven …

Read article →
ARTICLE · 088

Payment System Design, in depth

Payment system design for multiple providers: separating payments from attempts, a pure routing function with circuit breakers, resolving unknown outc…

Read article →
ARTICLE · 089

Rate Limiter Design, in depth: requirements, placement, rule model, counter choice, capacity and shadow rollout

How to design a production rate limiter from requirements to rollout: turning limits into a contract, choosing the layer, a descriptor-based rule mode…

Read article →
ARTICLE · 090

Saga Orchestration, in depth: building the orchestrator, step ordering around the pivot, commands over an outbox, timeouts, recovery and isolation

How to build and run a saga orchestrator: a persisted state machine, compensatable, pivot and retriable steps, commands and replies through a transact…

Read article →
ARTICLE · 091

Sharded Architecture, in depth: sharding the whole service stack, tenant placement, cross-shard work and moving tenants

How to design and run a service where the whole stack is sharded, not just the database: what lives inside a shard and what stays global, the edge rou…

Read article →
ARTICLE · 092

Twitter-Style Feed Design, in depth: requirements, capacity math, Snowflake IDs, hybrid fan-out, cursors and consistency

Designing a Twitter-style home feed from first principles: requirements, capacity arithmetic, a data model with time-sortable Snowflake IDs, a hybrid …

Read article →
ARTICLE · 093

Large File Upload Design, in depth: chunking, resumable protocols, parallel parts and the client upload engine

Designing uploads that survive real networks: why single requests fail, tus versus multipart, part sizing within S3 limits, parallelism and the bandwi…

Read article →
ARTICLE · 094

Video Platform Design (YouTube-Style), in depth: the control plane, from video lifecycle and playback sessions to resume and takedown propagation

The control plane of a YouTube-style video platform: an explicit video lifecycle state machine with an outbox, a playback-session API that decides acc…

Read article →
ARTICLE · 095

Telegram Architecture, in depth: MTProto 2.0, data centres, the update sequence, file and CDN delivery, and secret chats

How Telegram works as documented in its public protocol: MTProto transport and encryption layers, per-DC authorization keys and migration, pts/qts/seq…

Read article →
ARTICLE · 096

TikTok Architecture, in depth: a short-video feed that learns from every swipe, from upload and CDN to retrieval, ranking and minute-level online training

A reference architecture for a TikTok-style short-video recommendation feed: what the product demands, upload and delivery with client prefetch, multi…

Read article →
ARTICLE · 097

Twitter Timeline Generation Architecture, in depth: the Following cache, the For You ranking pipeline, and how both are served, repaired and kept fast

How Twitter-style home timelines are generated: the precomputed Following timeline cache and its fan-out workers, read-time merging and visibility fil…

Read article →
ARTICLE · 098

UPI Architecture, in depth: how India's real-time payment network routes, authenticates, settles and recovers from timeouts

How the Unified Payments Interface works as a system: the four parties around NPCI's central switch, VPA resolution, device binding and issuer-ve…

Read article →
ARTICLE · 099

Vector Search at Scale, in depth: segments, capacity math, sharding, filtering, re-embedding and recall in production

How to design a vector search service for hundreds of millions of embeddings: separate write and read paths, growing and sealed segments, worked memor…

Read article →
ARTICLE · 100

Video Streaming Architecture, in depth: ingest, chunked transcoding, bitrate ladders, HLS/DASH/CMAF packaging, CDN design, adaptive bitrate players and QoE

A system design walkthrough of a Netflix-style video-on-demand platform: requirements and capacity math, chunked parallel transcoding, per-title ladde…

Read article →
ARTICLE · 101

Website Hosting Architecture, in depth: DNS, TLS, CDN, origins and a deploy pipeline that never serves a broken page

End-to-end website hosting architecture: the five planes (naming, edge, origin, build and deploy, observation), choosing between static, static plus A…

Read article →
ARTICLE · 102

WeChat Super-App Architecture, in depth: sequence-number sync, Paxos storage, DAGOR overload control, mini programs and payments

How a super-app like WeChat is built, separating what Tencent has published from a labelled reference design: one long connection, message sync by per…

Read article →
ARTICLE · 103

WhatsApp Architecture, in depth: persistent connections, store-and-forward, Signal sessions, client fan-out for multi-device, Sender Keys for groups and encrypted media

How WhatsApp delivers end-to-end encrypted messages at scale: the long-lived connection layer, a routing registry and 30-day offline queue, prekeys an…

Read article →
ARTICLE · 104

YouTube Architecture, in depth: designing a user-generated video platform for uploads, processing pipelines, sharded metadata, view counting and edge delivery

A system design walkthrough of a YouTube-scale user-generated video platform: requirements and scale, resumable uploads, a per-video processing DAG wi…

Read article →
ARTICLE · 105

Zoom Video Conferencing Architecture, in depth: layered video, multimedia routers, transport fallback and encryption

How Zoom-style conferencing works: one scalable-video stream per sender, routers that forward layers instead of transcoding, a UDP-to-TLS transport la…

Read article →
ARTICLE · 106

Keep a Bookstore Order Consistent When One Service Fails

Follow a fictional order across stock reservation, payment authorization and confirmation, including timeouts and compensating actions.

Read article →
ARTICLE · 107

Build Price Recommendations That Respect Explicit Catalog Constraints

Explore a fictional bookstore pricing pipeline with reproducible inputs, bounded recommendations and a separate approval step.

Read article →

Views are my own and do not represent any employer, past or present.