fivenines

Learning library

Find the exact skill you want to practice.

Browse independently, or use Tracks when you want a recommended sequence.
166 tutorials
Build Your Own Redis20m

Single-node Core

Single-Node Key-Value Core

ArticlePracticeDesign

Build GET, SET, and DEL around one in-memory dictionary while defining clear command, reply, and missing-key semantics.

foundationOpen
Build Your Own Redis20m

Network Protocol

RESP Protocol Parser

ArticlePracticeDesign

Parse incremental RESP frames safely across partial reads, nested values, and malformed input before dispatching commands.

foundationOpen
Build Your Own Redis25m

Network Protocol

Client Connection Lifecycle

ArticlePracticeDesign

Trace each client from accept through buffered reads, command execution, queued replies, and connection teardown.

foundationOpen
Build Your Own Redis25m

Execution Core

Event Loop

ArticlePracticeDesign

Multiplex file readiness and timer work in one event loop while keeping handlers short enough to preserve responsiveness.

foundationOpen
Build Your Own Redis25m

Execution Core

Command Table And Dispatch

ArticlePracticeDesign

Drive validation, authorization, and execution from command metadata instead of hard-coding a separate request path for every command.

foundationOpen
Build Your Own Redis20m

Data Model

Redis Object Model

ArticlePracticeDesign

Separate logical value types from physical encodings so representation can change without changing command semantics.

foundationOpen
Build Your Own Redis25m

Data Model

Hash Table And Rehashing

ArticlePracticeDesign

Spread hash-table resizing across ordinary operations so rehashing avoids a single latency spike while lookups consult both tables.

foundationOpen
Build Your Own Redis25m

Memory Lifecycle

Expiration System

ArticlePracticeDesign

Combine lazy expiration on access with sampled active cleanup so expired keys disappear without blocking the server.

foundationOpen
Build Your Own Redis25m

Memory Lifecycle

Memory Limits And Eviction

ArticlePracticeDesign

Enforce maxmemory by selecting victims under an explicit eviction policy whose trade-offs match the workload.

foundationOpen
Build Your Own Redis25m

Data Model

Core Data Types

ArticlePracticeDesign

Choose encodings and operations for lists, hashes, sets, and sorted sets according to their access patterns and size.

foundationOpen
Build Your Own Redis25m

Command Behavior

Pipelining And Output Buffers

ArticlePracticeDesign

Pipeline requests to reduce round trips while bounding per-client output buffers so slow consumers cannot exhaust memory.

intermediateOpen
Build Your Own Redis30m

Command Behavior

Transactions

ArticlePracticeDesign

Queue commands between MULTI and EXEC, and use WATCH to abort optimistic transactions when observed keys change.

intermediateOpen
Build Your Own Redis25m

Command Behavior

Scripts/functions

ArticlePracticeDesign

Execute server-side scripts atomically by blocking interleaving, while controlling runtime so one script cannot stall every client.

intermediateOpen
Build Your Own Redis25m

Command Behavior

Pub/Sub

ArticlePracticeDesign

Fan published messages out to channel and pattern subscribers while accepting Pub/Sub's transient, at-most-once delivery semantics.

intermediateOpen
Build Your Own Redis30m

Command Behavior

Streams

ArticlePracticeDesign

Use ordered stream IDs, pending-entry tracking, acknowledgements, and claiming to divide durable work among consumers.

intermediateOpen
Build Your Own Redis30m

Persistence

RDB Snapshotting

ArticlePracticeDesign

Create point-in-time snapshots with fork and copy-on-write, balancing compact recovery files against snapshot cost and possible data loss.

intermediateOpen
Build Your Own Redis30m

Persistence

AOF Persistence

ArticlePracticeDesign

Use an append-only command log plus background rewrite to trade recovery fidelity against write amplification and file growth.

intermediateOpen
Build Your Own Redis30m

Persistence

Startup Recovery

ArticlePracticeDesign

Restore persisted state by loading an RDB snapshot or replaying AOF commands before accepting client traffic.

intermediateOpen
Build Your Own Redis30m

Replication And Failover

Replication: Full Sync

ArticlePracticeDesign

Bootstrap a replica from a consistent snapshot, then stream buffered writes so it catches up without losing changes made during transfer.

advancedOpen
Build Your Own Redis30m

Replication And Failover

Replication: Partial Sync

ArticlePracticeDesign

Resume replication from IDs, offsets, and a bounded backlog when history is available, falling back to full synchronization when it is not.

advancedOpen
Build Your Own Redis30m

Replication And Failover

Failover Controller

ArticlePracticeDesign

Use independent monitors, quorum, and epochs to promote one replica without letting competing observers create split-brain.

advancedOpen
Build Your Own Redis30m

Clustering

Cluster Sharding

ArticlePracticeDesign

Partition keys into hash slots and use MOVED redirects so clients can discover which node owns each key.

advancedOpen
Build Your Own Redis30m

Clustering

Cluster Resharding

ArticlePracticeDesign

Move hash slots live with migrating and importing states, ASK redirects, and dual-node coordination that preserves availability.

advancedOpen
Build Your Own Redis30m

Capstone

track Redis-Like System

ArticlePracticeDesign

Integrate protocol parsing, event handling, data structures, persistence, replication, and clustering into one coherent Redis-like system.

advancedOpen
Build Your Own PostgreSQL20m

Promises And Server Shape

What a database is really promising

ArticlePracticeDesign

Consider the worst possible moment for a system to improvise. Money has moved, two users press save at once, the power flickers, and a report asks a question nobody imagined whe...

foundationOpen
Build Your Own PostgreSQL20m

Promises And Server Shape

Processes, memory, and the shared system

ArticlePracticeDesign

From the application side, there is only "the database": one host, one port, one name in a connection string. Inside, it is a society with rules. Client work happens in backend ...

foundationOpen
Build Your Own PostgreSQL20m

Promises And Server Shape

The Wire Protocol and Session Lifecycle

ArticlePracticeDesign

Before a single query can mean anything, a connection has to become a session. An application opens a network connection and wants to talk in SQL, but the server cannot immediat...

foundationOpen
Build Your Own PostgreSQL20m

SQL Meaning Pipeline

SQL as a Language of Relations

ArticlePracticeDesign

SQL is often introduced as a convenient way to get rows out of tables. That description is practical but too small. SQL is powerful because it lets users describe a relation the...

foundationOpen
Build Your Own PostgreSQL20m

SQL Meaning Pipeline

Parsing SQL into trees

ArticlePracticeDesign

SQL enters the database as text, which is easy for people to write but unusable for an executor. The string contains spaces, keywords, identifiers, operators, literals, comments...

foundationOpen
Build Your Own PostgreSQL25m

SQL Meaning Pipeline

Binding Names, Types, and Schemas

ArticlePracticeDesign

After parsing, a SQL statement has shape but not yet meaning. The tree may say that a query selects `balance` from `accounts`, compares it to a literal, and orders by `created_a...

intermediateOpen
Build Your Own PostgreSQL25m

Planning And Execution

Turning queries into logical plans

ArticlePracticeDesign

An analyzed query knows what every name and expression means, but it still resembles the user's sentence. Planning begins by moving from sentence shape to relational structure. ...

intermediateOpen
Build Your Own PostgreSQL25m

Planning And Execution

Costs, cardinality, and choosing a plan

ArticlePracticeDesign

Query planning matters because equivalent plans are not equally fast. Two plans can produce the same rows and still differ by seconds, by minutes, or by an outage. A Postgre-lik...

intermediateOpen
Build Your Own PostgreSQL25m

Planning And Execution

Executors as Iterator Machines

ArticlePracticeDesign

A plan is a promise about how to produce rows. The executor is the machinery that keeps that promise. It opens plan nodes, asks them for tuples, passes those tuples upward, and ...

intermediateOpen
Build Your Own PostgreSQL25m

Storage And Durability

Rows, Pages, and Heap Storage

ArticlePracticeDesign

The executor thinks in tuples, but disks and memory move in pages. Heap storage is the layer that turns table rows into bytes arranged inside fixed-size blocks. This is where a ...

intermediateOpen
Build Your Own PostgreSQL25m

Storage And Durability

Buffer Pools and the Memory-Disk Border

ArticlePracticeDesign

Heap pages live on disk, but a database that touched disk for every row would be unusable. The buffer pool is the shared memory region that holds copies of disk pages while back...

intermediateOpen
Build Your Own PostgreSQL25m

Storage And Durability

Write-Ahead Logging and the Durability Contract

ArticlePracticeDesign

Durability sounds simple from the outside. After commit, the data should not vanish. The straightforward way to deliver that is too slow inside a database. Writing every changed...

advancedOpen
Build Your Own PostgreSQL25m

Storage And Durability

Transactions and the illusion of instant change

ArticlePracticeDesign

A transaction lets users treat several actions as one change. You transfer money by debiting one account and crediting another. You create an order, reserve inventory, and recor...

advancedOpen
Build Your Own PostgreSQL25m

Concurrency And History

MVCC and reading the past

ArticlePracticeDesign

Multi-version concurrency control starts from a practical goal: readers should not have to stop the world to get a stable answer. Instead of overwriting rows in place and forcin...

advancedOpen
Build Your Own PostgreSQL25m

Concurrency And History

Locks, Latches, and Coordination

ArticlePracticeDesign

MVCC lets readers and writers avoid many direct conflicts, but a database still needs coordination everywhere. A table cannot be dropped while another session scans it. Two proc...

advancedOpen
Build Your Own PostgreSQL25m

Concurrency And History

Indexes as ordered shortcuts

ArticlePracticeDesign

An index lets the database find candidate rows without reading the whole table. It is not a second copy of the table in a prettier format. It is a maintained access path, tuned ...

intermediateOpen
Build Your Own PostgreSQL25m

Concurrency And History

Maintaining indexes through change

ArticlePracticeDesign

Indexes answer reads quickly, but they cost something on every write. Each insert, update, and delete must keep every relevant index consistent with the heap's versioned reality...

advancedOpen
Build Your Own PostgreSQL25m

Concurrency And History

Vacuum and the Cost of History

ArticlePracticeDesign

MVCC lets the database keep old tuple versions so readers can see a stable past. Vacuum is the process that decides when the past can be physically removed. Without vacuum, ever...

advancedOpen
Build Your Own PostgreSQL25m

Recovery Metadata And Extensibility

Checkpoints and Crash Recovery

ArticlePracticeDesign

A database crash is not exceptional in the design. It is expected. Power can fail after WAL reaches disk but before data pages do. The operating system can stop the process whil...

advancedOpen
Build Your Own PostgreSQL25m

Recovery Metadata And Extensibility

Catalogs as the database about the database

ArticlePracticeDesign

A relational database holds more than data. It also holds descriptions of that data. Tables have columns, columns have types, indexes belong to tables, functions accept argument...

intermediateOpen
Build Your Own PostgreSQL25m

Recovery Metadata And Extensibility

Functions, Operators, and Extensibility

ArticlePracticeDesign

A database becomes much more powerful when its behavior is not sealed at compile time. Postgre-like systems treat functions, operators, types, casts, aggregates, and index suppo...

advancedOpen
Build Your Own PostgreSQL25m

Scale And Distributed Shape

Isolation Levels and Anomalies

ArticlePracticeDesign

Transactions make changes feel atomic, but isolation decides how transactions overlap. This is where databases stop being simple state machines and start managing concurrent tim...

advancedOpen
Build Your Own PostgreSQL25m

Scale And Distributed Shape

Replication and Streaming Change

ArticlePracticeDesign

Replication begins with a practical concern. A database should not be a single fragile point. A standby can take over after failure, serve read traffic, back up data, or feed do...

advancedOpen
Build Your Own PostgreSQL25m

Scale And Distributed Shape

Partitioning and distributed shape

ArticlePracticeDesign

Partitioning starts with a table that has grown too large or too busy to manage as one physical object, or that divides naturally along some boundary. To the user the logical re...

advancedOpen
Build Your Own PostgreSQL25m

Architecture Synthesis

The Whole Machine

ArticlePracticeDesign

By now the database no longer looks like a black box behind a port. It looks like a layered machine that turns statements into durable, queryable state. Each layer has a narrow ...

advancedOpen
Build Your Own Uber20m

Orientation

The product: a ride exchange

ArticlePracticeDesign

Model ride hailing as a two-sided, real-time marketplace whose core loop is request, quote, match, trip, payment, and feedback.

foundationOpen
Build Your Own Uber20m

Orientation

Non-functional requirements: nines math and the scale envelope

ArticlePracticeDesign

Translate demand, latency, availability, durability, RPO, and RTO into numeric constraints that architecture decisions can be tested against.

foundationOpen
Build Your Own Uber20m

Three Nines — 99.9%

The system skeleton

ArticlePracticeDesign

Separate edge, identity, marketplace, trip, payment, communication, and data-platform responsibilities around a small set of authoritative state flows.

foundationOpen
Build Your Own Uber20m

Three Nines — 99.9%

Identity and onboarding

ArticlePracticeDesign

Separate authentication, rider and driver profiles, document verification, and account state so onboarding checks do not leak into every service.

foundationOpen
Build Your Own Uber20m

Three Nines — 99.9%

Maps, routing, and ETA

ArticlePracticeDesign

Combine map data, routing, traffic signals, and continuous ETA correction while isolating uncertain predictions from trip truth.

foundationOpen
Build Your Own Uber20m

Three Nines — 99.9%

Driver presence and location ingestion

ArticlePracticeDesign

Ingest high-rate, ephemeral driver updates with freshness rules and spatial indexing so nearby-driver views remain useful without pretending every point is durable truth.

foundationOpen
Build Your Own Uber20m

Three Nines — 99.9%

Quotes and pricing v1: surge as market clearing

ArticlePracticeDesign

Produce expiring price quotes from supply and demand, using surge to balance the market without rewriting an accepted trip's price.

foundationOpen
Build Your Own Uber20m

Three Nines — 99.9%

The matching engine: clearing the market

ArticlePracticeDesign

Rank feasible driver–rider pairs under location, ETA, and marketplace constraints while keeping dispatch decisions explicit and auditable.

foundationOpen
Build Your Own Uber20m

Three Nines — 99.9%

Trip lifecycle: the state machine of record

ArticlePracticeDesign

Make the trip state machine the source of truth, enforcing legal transitions and idempotent commands across request, match, pickup, and completion.

foundationOpen
Build Your Own Uber20m

Three Nines — 99.9%

Payments, ledger, and payouts

ArticlePracticeDesign

Record money movement in an immutable double-entry ledger while isolating processor retries, reconciliation, and driver payouts from trip state.

foundationOpen
Build Your Own Uber20m

Three Nines — 99.9%

Notifications, chat, and masked calls

ArticlePracticeDesign

Treat push, chat, and masked calling as asynchronous, privacy-preserving channels that support a trip without becoming its source of truth.

foundationOpen
Build Your Own Uber20m

Three Nines — 99.9%

Ratings, history, support, and admin

ArticlePracticeDesign

Build read models and privileged workflows around immutable trip history so support actions are auditable and operational tools stay off the hot path.

foundationOpen
Build Your Own Uber20m

Three Nines — 99.9%

Infrastructure baseline: one region, three zones

ArticlePracticeDesign

Start with one region spread across three zones, using stateless services and zonally redundant data to survive a single-zone failure.

foundationOpen
Build Your Own Uber20m

Three Nines — 99.9%

Observability v1: golden signals and on-call

ArticlePracticeDesign

Instrument latency, traffic, errors, and saturation, then connect actionable alerts to an on-call response loop.

foundationOpen
Build Your Own Uber20m

Three Nines — 99.9%

Data platform, BI, and reporting v1

ArticlePracticeDesign

Move operational events into an analytical pipeline so reporting workloads cannot destabilize the transactional ride path.

foundationOpen
Build Your Own Uber20m

Three Nines — 99.9%

Recap: what 99.9% buys — and what breaks

ArticlePracticeDesign

Recognize that a three-nines baseline tolerates hours of annual disruption and still fails under zonal loss, overload, and fragile dependencies.

foundationOpen
Build Your Own Uber20m

Four Nines — 99.99%

SLOs, error budgets, and criticality tiers

ArticlePracticeDesign

Give user journeys explicit SLOs and criticality tiers so scarce reliability investment follows impact and remaining error budget.

intermediateOpen
Build Your Own Uber20m

Four Nines — 99.99%

Hardening the topology

ArticlePracticeDesign

Remove hidden single points of failure by adding zonal redundancy, independent dependencies, health-aware routing, and bounded failover.

intermediateOpen
Build Your Own Uber20m

Four Nines — 99.99%

Data layer: sharding and automated failover

ArticlePracticeDesign

Shard state by stable ownership keys and automate fenced failover so growth and replica loss do not require unsafe manual intervention.

intermediateOpen
Build Your Own Uber20m

Four Nines — 99.99%

The event backbone: outbox, idempotency, replay

ArticlePracticeDesign

Publish state changes through a transactional outbox and make consumers idempotent so events can be retried and replayed safely.

intermediateOpen
Build Your Own Uber20m

Four Nines — 99.99%

Matching at scale: geo-sharded dispatch

ArticlePracticeDesign

Partition dispatch by geography, manage boundary spillover, and keep candidate search local enough to scale without missing viable drivers.

intermediateOpen
Build Your Own Uber20m

Four Nines — 99.99%

Resilience patterns: timeouts, breakers, shedding, degradation

ArticlePracticeDesign

Combine deadlines, bounded retries, circuit breakers, load shedding, and graceful degradation so dependency trouble does not cascade.

intermediateOpen
Build Your Own Uber20m

Four Nines — 99.99%

Multi-region disaster recovery: active–passive

ArticlePracticeDesign

Replicate critical state to a passive region and define detection, fencing, traffic shift, RPO, and RTO for a controlled regional failover.

intermediateOpen
Build Your Own Uber20m

Four Nines — 99.99%

Safe change: canaries, flags, and reversible migrations

ArticlePracticeDesign

Reduce deployment risk with canaries, feature flags, backward-compatible schemas, and migrations that can be paused or reversed.

intermediateOpen
Build Your Own Uber20m

Four Nines — 99.99%

Observability v2: SLO-driven operations

ArticlePracticeDesign

Turn user-facing SLIs into SLOs and error budgets that govern alerting, reliability work, and release pace.

intermediateOpen
Build Your Own Uber20m

Four Nines — 99.99%

Streaming data platform and real-time BI

ArticlePracticeDesign

Stream immutable operational events into replayable processing so real-time metrics and features do not couple analytics to production databases.

intermediateOpen
Build Your Own Uber20m

Four Nines — 99.99%

Fraud, security, and compliance

ArticlePracticeDesign

Layer identity, authorization, encryption, audit trails, and risk signals around sensitive ride and payment flows without overloading the hot path.

intermediateOpen
Build Your Own Uber20m

Four Nines — 99.99%

Recap: the four-nines checklist

ArticlePracticeDesign

Validate that every critical ride path has zonal redundancy, bounded failover, overload protection, observability, and safe-change controls.

intermediateOpen
Build Your Own Uber20m

Five Nines — 99.999%

Where five nines is worth it — and where it's waste

ArticlePracticeDesign

Apply five nines only to safety- and trip-critical paths, allowing less critical analytics and convenience features to fail more cheaply.

advancedOpen
Build Your Own Uber20m

Five Nines — 99.999%

Active–active multi-region with regional homes

ArticlePracticeDesign

Assign each trip and user a regional home while serving traffic from multiple regions, avoiding cross-region write conflicts during normal operation.

advancedOpen
Build Your Own Uber20m

Five Nines — 99.999%

Cell-based architecture: bounding the blast radius

ArticlePracticeDesign

Group compute and data into repeatable cells so a hot market or failed dependency affects only its assigned riders and drivers.

advancedOpen
Build Your Own Uber20m

Five Nines — 99.999%

State at five nines: quorum truth, ephemeral speed

ArticlePracticeDesign

Use quorum-backed storage for authoritative state and disposable fast stores for location and presence, matching consistency cost to data semantics.

advancedOpen
Build Your Own Uber20m

Five Nines — 99.999%

Static stability: the data plane outlives the control plane

ArticlePracticeDesign

Precompute and cache routing and ownership decisions so existing rides continue when control-plane services are unavailable.

advancedOpen
Build Your Own Uber20m

Five Nines — 99.999%

Client-side resilience: the app is part of the architecture

ArticlePracticeDesign

Make mobile clients retry safely, cache useful state, and communicate degraded service because intermittent networks are part of the system.

advancedOpen
Build Your Own Uber20m

Five Nines — 99.999%

Chaos engineering and gamedays: rehearsing the theory

ArticlePracticeDesign

Use hypothesis-driven failure injection and gamedays to prove that detection, degradation, and recovery work under realistic conditions.

advancedOpen
Build Your Own Uber20m

Five Nines — 99.999%

Observability v3: probes, client truth, and auto-remediation

ArticlePracticeDesign

Combine synthetic probes, client telemetry, and guarded automation to detect failures invisible to server metrics and remediate known cases safely.

advancedOpen
Build Your Own Uber20m

Five Nines — 99.999%

The operating model and the cost of a nine

ArticlePracticeDesign

Treat additional availability as an ongoing staffing and complexity cost, supported by ownership, runbooks, incident learning, and capacity discipline.

advancedOpen
Build Your Own Uber20m

Five Nines — 99.999%

The final architecture

ArticlePracticeDesign

Assemble cells, regional homes, durable event flows, layered state, observability, and safe operations into one selectively five-nines ride exchange.

advancedOpen
Build Your Own Stock Exchange20m

Orientation

What a stock exchange actually does

ArticlePracticeDesign

Understand an exchange as an ordered market that accepts constrained orders, discovers prices, publishes trades, and hands obligations downstream.

foundationOpen
Build Your Own Stock Exchange20m

Orientation

The full requirements map

ArticlePracticeDesign

Map functional flows, scale, latency, consistency, availability, and recovery requirements before committing to component boundaries.

foundationOpen
Build Your Own Stock Exchange20m

Orientation

Reading the nines: availability as a budget

ArticlePracticeDesign

Convert availability percentages into concrete downtime and failed-request budgets before choosing an architecture.

foundationOpen
Build Your Own Stock Exchange20m

Three Nines — 99.9%

Architecture of a complete exchange

ArticlePracticeDesign

Decompose an exchange into order entry, risk, matching, market data, and post-trade boundaries connected by explicit event flows.

foundationOpen
Build Your Own Stock Exchange20m

Three Nines — 99.9%

The life of an order

ArticlePracticeDesign

Trace an order through validation, risk, sequencing, matching, acknowledgement, market data, and post-trade processing.

foundationOpen
Build Your Own Stock Exchange20m

Three Nines — 99.9%

The order book and price-time priority

ArticlePracticeDesign

Represent bids and asks so the matcher always selects the best price first and preserves arrival order within each price level.

foundationOpen
Build Your Own Stock Exchange20m

Three Nines — 99.9%

The order state machine

ArticlePracticeDesign

Encode accepted, active, partially filled, filled, canceled, and rejected transitions so retries cannot produce impossible order states.

foundationOpen
Build Your Own Stock Exchange20m

Three Nines — 99.9%

Order types and time in force

ArticlePracticeDesign

Translate order types and time-in-force rules into explicit matching constraints so execution behavior is deterministic and testable.

foundationOpen
Build Your Own Stock Exchange20m

Three Nines — 99.9%

Auctions, halts, and safeguards

ArticlePracticeDesign

Use auctions, volatility controls, and trading halts to restore orderly price discovery when continuous matching becomes unsafe.

foundationOpen
Build Your Own Stock Exchange20m

Three Nines — 99.9%

Determinism: the event log is the exchange

ArticlePracticeDesign

Make every matching decision a deterministic function of an ordered event log so replicas can replay and recover identical state.

foundationOpen
Build Your Own Stock Exchange20m

Three Nines — 99.9%

Market data at scale

ArticlePracticeDesign

Publish sequenced snapshots and incremental updates through a fanout path that lets consumers detect gaps and rebuild state.

foundationOpen
Build Your Own Stock Exchange20m

Three Nines — 99.9%

Accounts, custody, and pre-trade risk

ArticlePracticeDesign

Keep matching fast and safe by checking balances, positions, limits, and custody constraints before an order reaches the book.

foundationOpen
Build Your Own Stock Exchange20m

Three Nines — 99.9%

Post-trade: clearing and settlement

ArticlePracticeDesign

Separate execution from clearing and settlement, carrying immutable trades into obligations, netting, and final asset transfer.

foundationOpen
Build Your Own Stock Exchange20m

Three Nines — 99.9%

Scaling to millions of users

ArticlePracticeDesign

Scale participants by partitioning session and market-data fanout while preserving a narrow, deterministically ordered matching core.

foundationOpen
Build Your Own Stock Exchange20m

Three Nines — 99.9%

Operating at three nines: crash, restart, replay

ArticlePracticeDesign

Achieve a credible three-nines baseline by persisting ordered events and rebuilding deterministic state after process crashes.

foundationOpen
Build Your Own Stock Exchange20m

Four Nines — 99.99%

The four-nines contract: audit your SPOFs

ArticlePracticeDesign

Audit every critical request path for single points of failure, including hidden dependencies shared across otherwise redundant components.

intermediateOpen
Build Your Own Stock Exchange20m

Four Nines — 99.99%

The hot standby: replicated state machines

ArticlePracticeDesign

Replicate an ordered input log to a hot standby so deterministic replay produces a ready-to-promote copy of matching state.

intermediateOpen
Build Your Own Stock Exchange20m

Four Nines — 99.99%

Reliable messaging: gaps, NAKs, retransmits

ArticlePracticeDesign

Sequence messages and repair detected gaps with NAKs, retransmission, and snapshots instead of pretending packet delivery is perfect.

intermediateOpen
Build Your Own Stock Exchange20m

Four Nines — 99.99%

Sessions that survive failure

ArticlePracticeDesign

Decouple durable session identity and sequence state from individual gateways so clients can reconnect without duplicating or losing orders.

intermediateOpen
Build Your Own Stock Exchange20m

Four Nines — 99.99%

Change without downtime

ArticlePracticeDesign

Deploy compatible, reversible changes with canaries, dual-version protocols, and staged migrations so trading continues during upgrades.

intermediateOpen
Build Your Own Stock Exchange20m

Four Nines — 99.99%

Deciding who leads: failure detection without split-brain

ArticlePracticeDesign

Combine failure detection, quorum-backed leases, fencing, and epochs so only one matching leader can accept orders.

intermediateOpen
Build Your Own Stock Exchange20m

Four Nines — 99.99%

Degrade, don't die: overload protection

ArticlePracticeDesign

Protect order entry and matching with admission control and load shedding, degrading noncritical work before queues collapse.

intermediateOpen
Build Your Own Stock Exchange20m

Four Nines — 99.99%

Four nines at scale: multi-zone anatomy

ArticlePracticeDesign

Reach four nines by spreading critical components across zones, removing shared failure domains, and automating bounded failover.

intermediateOpen
Build Your Own Stock Exchange20m

Four Nines — 99.99%

The four-nines architecture, assembled

ArticlePracticeDesign

Assemble multi-zone redundancy, automated failover, durable logs, and overload controls into a coherent four-nines exchange.

intermediateOpen
Build Your Own Stock Exchange20m

Five Nines — 99.999%

Five nines where it counts — and nowhere else

ArticlePracticeDesign

Reserve five-nines engineering for the trading paths whose failure causes the most harm, and give supporting systems cheaper targets.

advancedOpen
Build Your Own Stock Exchange20m

Five Nines — 99.999%

Consensus in the hot path

ArticlePracticeDesign

Keep consensus out of per-order execution where possible, using it to establish ownership while a single leader orders the hot path.

advancedOpen
Build Your Own Stock Exchange20m

Five Nines — 99.999%

Losing a datacenter gracefully

ArticlePracticeDesign

Survive regional loss with preplanned traffic shifts, fenced ownership, replicated state, and explicit recovery-point trade-offs.

advancedOpen
Build Your Own Stock Exchange20m

Five Nines — 99.999%

Cells: capping the blast radius

ArticlePracticeDesign

Partition the exchange into self-contained cells so overload or failure in one market segment cannot consume the whole platform.

advancedOpen
Build Your Own Stock Exchange20m

Five Nines — 99.999%

Gray failures and chaos drills

ArticlePracticeDesign

Expose partial and ambiguous failures with targeted probes and chaos drills that verify detection, isolation, and recovery before production does.

advancedOpen
Build Your Own Stock Exchange20m

Five Nines — 99.999%

The riskiest component is change

ArticlePracticeDesign

Treat deployment as a failure mode and reduce its blast radius with staged rollout, compatibility, observability, and fast rollback.

advancedOpen
Build Your Own Stock Exchange20m

Five Nines — 99.999%

The five-nines architecture, assembled

ArticlePracticeDesign

Assemble cells, multi-region ownership, static stability, and disciplined operations into a five-nines design with bounded failure domains.

advancedOpen
Build Your Own Stock Exchange20m

Five Nines — 99.999%

track: the whole exchange, end to end

ArticlePracticeDesign

Connect order entry, risk, deterministic matching, market data, clearing, and recovery into one end-to-end exchange design.

advancedOpen
Build Your Own Stock Exchange20m

The Fast Exchange — Milliseconds to Microseconds

Latency is a fairness property

ArticlePracticeDesign

Control latency variance across participants because unequal access time can distort price-time priority even when matching is correct.

Build Your Own Stock Exchange20m

The Fast Exchange — Milliseconds to Microseconds

Measuring without lying

ArticlePracticeDesign

Measure end-to-end latency with coordinated timestamps, percentiles, and realistic load so queues and tail behavior remain visible.

Build Your Own Stock Exchange20m

The Fast Exchange — Milliseconds to Microseconds

The millisecond rung: architecture-level latency

ArticlePracticeDesign

Reach millisecond latency by shortening synchronous paths, bounding queues, colocating dependencies, and eliminating avoidable network hops.

Build Your Own Stock Exchange20m

The Fast Exchange — Milliseconds to Microseconds

The microsecond rung: mechanical sympathy

ArticlePracticeDesign

Reach microsecond latency by aligning data layout, CPU affinity, memory access, and network I/O with the hardware's actual costs.

Build Your Own Stock Exchange20m

The Fast Exchange — Milliseconds to Microseconds

Jitter: the tail is the product

ArticlePracticeDesign

Treat tail latency and jitter as first-class outcomes because unpredictable delay undermines both throughput and participant fairness.

Build Your Own Stock Exchange20m

The Fast Exchange — Milliseconds to Microseconds

Fairness engineering

ArticlePracticeDesign

Turn fairness into enforceable ordering rules, synchronized ingress, and auditable timestamps rather than relying on average latency.

Build Your Own Stock Exchange20m

The Fast Exchange — Milliseconds to Microseconds

When nines fight microseconds

ArticlePracticeDesign

Resolve reliability–latency conflicts by keeping the hot path minimal while moving replication and recovery work to carefully bounded boundaries.

Build Your Own Docker20m

Foundations

What Problem Does Docker Solve?

ArticlePracticeDesign

Learn What Problem Does Docker Solve? while evolving MiniDock, a complete container engine designed from first principles.

foundationOpen
Build Your Own Docker20m

Foundations

Containers vs. Virtual Machines

ArticlePracticeDesign

Learn Containers vs. Virtual Machines while evolving MiniDock, a complete container engine designed from first principles.

foundationOpen
Build Your Own Docker20m

Foundations

The Layered Runtime Architecture

ArticlePracticeDesign

Learn The Layered Runtime Architecture while evolving MiniDock, a complete container engine designed from first principles.

foundationOpen
Build Your Own Docker20m

Foundations

Namespaces: The Walls

ArticlePracticeDesign

Learn Namespaces: The Walls while evolving MiniDock, a complete container engine designed from first principles.

foundationOpen
Build Your Own Docker20m

Foundations

Cgroups: The Meters

ArticlePracticeDesign

Learn Cgroups: The Meters while evolving MiniDock, a complete container engine designed from first principles.

foundationOpen
Build Your Own Docker20m

Foundations

The Security Sandwich

ArticlePracticeDesign

Learn The Security Sandwich while evolving MiniDock, a complete container engine designed from first principles.

foundationOpen
Build Your Own Docker20m

Images

Anatomy of an Image

ArticlePracticeDesign

Learn Anatomy of an Image while evolving MiniDock, a complete container engine designed from first principles.

foundationOpen
Build Your Own Docker20m

Images

Content Addressing

ArticlePracticeDesign

Learn Content Addressing while evolving MiniDock, a complete container engine designed from first principles.

foundationOpen
Build Your Own Docker20m

Images

Union Filesystems

ArticlePracticeDesign

Learn Union Filesystems while evolving MiniDock, a complete container engine designed from first principles.

foundationOpen
Build Your Own Docker20m

Images

Building Images

ArticlePracticeDesign

Learn Building Images while evolving MiniDock, a complete container engine designed from first principles.

foundationOpen
Build Your Own Docker20m

Images

The Build Cache

ArticlePracticeDesign

Learn The Build Cache while evolving MiniDock, a complete container engine designed from first principles.

foundationOpen
Build Your Own Docker20m

Images

Multi-Stage Builds

ArticlePracticeDesign

Learn Multi-Stage Builds while evolving MiniDock, a complete container engine designed from first principles.

foundationOpen
Build Your Own Docker20m

Images

The On-Disk Stores

ArticlePracticeDesign

Learn The On-Disk Stores while evolving MiniDock, a complete container engine designed from first principles.

foundationOpen
Build Your Own Docker20m

Distribution

Registry Architecture

ArticlePracticeDesign

Learn Registry Architecture while evolving MiniDock, a complete container engine designed from first principles.

intermediateOpen
Build Your Own Docker20m

Distribution

Pull, End to End

ArticlePracticeDesign

Learn Pull, End to End while evolving MiniDock, a complete container engine designed from first principles.

intermediateOpen
Build Your Own Docker20m

Distribution

Push and Dedup

ArticlePracticeDesign

Learn Push and Dedup while evolving MiniDock, a complete container engine designed from first principles.

intermediateOpen
Build Your Own Docker20m

Distribution

Tags, References, and Garbage

ArticlePracticeDesign

Learn Tags, References, and Garbage while evolving MiniDock, a complete container engine designed from first principles.

intermediateOpen
Build Your Own Docker20m

Runtime

The Container Lifecycle

ArticlePracticeDesign

Learn The Container Lifecycle while evolving MiniDock, a complete container engine designed from first principles.

intermediateOpen
Build Your Own Docker20m

Runtime

docker run: The Full Picture

ArticlePracticeDesign

Learn docker run: The Full Picture while evolving MiniDock, a complete container engine designed from first principles.

intermediateOpen
Build Your Own Docker20m

Runtime

Copy-on-Write at Runtime

ArticlePracticeDesign

Learn Copy-on-Write at Runtime while evolving MiniDock, a complete container engine designed from first principles.

intermediateOpen
Build Your Own Docker20m

Runtime

Supervision and Restart Policies

ArticlePracticeDesign

Learn Supervision and Restart Policies while evolving MiniDock, a complete container engine designed from first principles.

intermediateOpen
Build Your Own Docker20m

Runtime

exec, attach, and logs

ArticlePracticeDesign

Learn exec, attach, and logs while evolving MiniDock, a complete container engine designed from first principles.

intermediateOpen
Build Your Own Docker20m

Runtime

Stopping Gracefully

ArticlePracticeDesign

Learn Stopping Gracefully while evolving MiniDock, a complete container engine designed from first principles.

intermediateOpen
Build Your Own Docker20m

Runtime

Health Checks

ArticlePracticeDesign

Learn Health Checks while evolving MiniDock, a complete container engine designed from first principles.

intermediateOpen
Build Your Own Docker20m

Storage

Volumes, Binds, tmpfs

ArticlePracticeDesign

Learn Volumes, Binds, tmpfs while evolving MiniDock, a complete container engine designed from first principles.

advancedOpen
Build Your Own Docker20m

Storage

Volume Lifecycle and Drivers

ArticlePracticeDesign

Learn Volume Lifecycle and Drivers while evolving MiniDock, a complete container engine designed from first principles.

advancedOpen
Build Your Own Docker20m

Storage

Storage Drivers

ArticlePracticeDesign

Learn Storage Drivers while evolving MiniDock, a complete container engine designed from first principles.

advancedOpen
Build Your Own Docker20m

Networking

The Container Network Model

ArticlePracticeDesign

Learn The Container Network Model while evolving MiniDock, a complete container engine designed from first principles.

advancedOpen
Build Your Own Docker20m

Networking

Bridge Networking

ArticlePracticeDesign

Learn Bridge Networking while evolving MiniDock, a complete container engine designed from first principles.

advancedOpen
Build Your Own Docker20m

Networking

Publishing Ports

ArticlePracticeDesign

Learn Publishing Ports while evolving MiniDock, a complete container engine designed from first principles.

advancedOpen
Build Your Own Docker20m

Networking

DNS and Service Discovery

ArticlePracticeDesign

Learn DNS and Service Discovery while evolving MiniDock, a complete container engine designed from first principles.

advancedOpen
Build Your Own Docker20m

Networking

Host, None, and the Driver Seam

ArticlePracticeDesign

Learn Host, None, and the Driver Seam while evolving MiniDock, a complete container engine designed from first principles.

advancedOpen
Build Your Own Docker20m

Networking

Overlay Networks

ArticlePracticeDesign

Learn Overlay Networks while evolving MiniDock, a complete container engine designed from first principles.

advancedOpen
Build Your Own Docker20m

Orchestration

Compose: Declarative Applications

ArticlePracticeDesign

Learn Compose: Declarative Applications while evolving MiniDock, a complete container engine designed from first principles.

Build Your Own Docker20m

Orchestration

Dependency Ordering

ArticlePracticeDesign

Learn Dependency Ordering while evolving MiniDock, a complete container engine designed from first principles.

Build Your Own Docker20m

Orchestration

Swarm Architecture

ArticlePracticeDesign

Learn Swarm Architecture while evolving MiniDock, a complete container engine designed from first principles.

Build Your Own Docker20m

Orchestration

Services, Tasks, and Reconciliation

ArticlePracticeDesign

Learn Services, Tasks, and Reconciliation while evolving MiniDock, a complete container engine designed from first principles.

Build Your Own Docker20m

Production & Capstone

Events, Logs, and Metrics

ArticlePracticeDesign

Learn Events, Logs, and Metrics while evolving MiniDock, a complete container engine designed from first principles.

Build Your Own Docker20m

Production & Capstone

Hardening MiniDock

ArticlePracticeDesign

Learn Hardening MiniDock while evolving MiniDock, a complete container engine designed from first principles.

Build Your Own Docker20m

Production & Capstone

track: The Full Map

ArticlePracticeDesign

Learn track: The Full Map while evolving MiniDock, a complete container engine designed from first principles.