Tale & Theory

Books / Visual learning guide

System Design - Online Shopping — Visual Learning Guide

Theme: Computing & AI

This Visual Learning Guide develops the reasoning behind the online shopping system in the companion comic. It begins with customer and staff needs, a realistic first release and testable promises about speed, inventory, payments and private orders. The chapter sequence then follows web requests, a working architecture, capacity estimates, storage, queries, concurrent updates and search before exploring caching, scaling, asynchronous work, failure handling, distributed agreement and security. Original diagrams make boundaries and data movement visible. Worked situations state assumptions, attach units to estimates and compare the costs of alternative choices. Practice includes explanations of the answers. This is an independent educational resource built around a fictional shop, without benchmark, certification or examination claims. All sixteen chapters are included, with worked reasoning and answered practice.

Start reading →View in the interactive library
System Design - Online Shopping — Visual Learning Guide cover

About this book

System Design - Online Shopping — Visual Learning Guide turns a fictional retailer’s engineering decisions into a structured course in architectural reasoning. It is designed for readers who want to understand why a component is present, which promise it supports and what can go wrong when it communicates with another component. The guide follows the companion comic’s chapter sequence while providing original explanatory prose, diagrams, worked situations and practice. All sixteen chapters are included, from the initial requirements through the closing design, measurement and improvement loop. The starting point is a complete purchase journey. A shopper needs to find a product, build a basket, make a safe purchase and retrieve an honest order outcome. Staff need controlled ways to maintain products, prices and inventory. These actions become a design brief with scope, constraints and measurable acceptance criteria. The last-item race and repeated-payment attempt show why correctness cannot be inferred from an attractive interface or a successful network response. Different operations can need different freshness, availability and authorisation guarantees. The next part of the sequence traces requests from the browser through naming, transport, application routing and storage, then back to a rendered page. It separates the roles of DNS, TCP, TLS and HTTP in an explicitly simplified trace. The architecture discussion builds on this foundation with a first working system, then uses capacity estimates and measured bottlenecks to motivate change. Calculations retain their units and assumptions so that a request rate is not confused with a user count, a transfer estimate with a complete page-load time, or a planning hypothesis with measured capacity. Data becomes the focus through storage selection, record relationships, query plans, indexes, transactions and concurrent changes. Search and caching introduce derived representations whose freshness and failure behaviour must be understood. Scaling discussions distinguish application capacity from database constraints and explain why replication, partitioning and independent services solve different problems. The aim is to compare mechanisms against a workload and a business rule rather than memorise a fashionable collection of technologies. The later sequence considers work that can happen after a customer response, repeated messages, partial failures and conflicting views of state. These topics connect back to stable operation identities, authoritative decisions and truthful status reporting. Security is treated through trust boundaries, resource ownership and carefully limited capabilities. The closing design loop asks readers to state a hypothesis, measure relevant outcomes, test failure behaviour and revise the architecture when evidence warrants it. Across the guide, original diagrams expose request paths, shared state and dependency boundaries. Worked examples explain the reason for each step and identify the circumstances in which an answer would change. Exercises include conceptual checks, calculations and design decisions with reasoned answers. References point to primary engineering standards and documentation where they support specific mechanisms. The shop, workloads and measurements are educational scenarios, not observations of a real retailer. This independent learning resource makes no claim of vendor affiliation, professional certification, official curriculum alignment or guaranteed interview outcomes.

Published chapters

  1. Before We Build the Shop — Visual Learning Guide

    Build a testable design brief for the online shop, with customer and staff actions, realistic scope, inventory and payment invariants, performance calculations, access rules and worked practice.

  2. The Journey of One Click — Visual Learning Guide

    Trace a product-page request through DNS, TCP, TLS, HTTP, application storage and browser rendering, using original dependency diagrams, timing calculations and diagnostic exercises.

  3. Our First Working System — Visual Learning Guide

    Build a minimal shop architecture with modular code, deliberate data and file storage, trusted checkout calculations, local transactions and careful recovery across payment and fulfilment boundaries.

  4. How Much Is Enough — Visual Learning Guide

    Estimate demand, storage and bandwidth with explicit units, interpret mean and tail latency, apply the limits of Little's law and design realistic load tests for the shop.

  5. Where Should Everything Live — Visual Learning Guide

    Choose storage through relationships, access patterns, guarantees and lifecycle. Compare relational, document, key-value and object models while preserving historical facts, expiry rules and authority.

  6. Why Is This Query So Slow — Visual Learning Guide

    Diagnose query work through plans, selectivity and statistics; reason about composite indexes and their costs; compare offset and keyset pagination with explicit ordering and live-data limits.

  7. Two People Edit the Same Record — Visual Learning Guide

    Protect limited stock and shared edits with explicit invariants, atomic conditions, local transactions, short locks and scoped version checks; reason about retries, expiry races and test evidence.

  8. Finding the Right Product — Visual Learning Guide

    Trace exact lookup, typed filters and language search through analysis, inverted indexes and ranking, then design freshness, authoritative validation and evidence-led relevance evaluation.

  9. The Same Page a Thousand Times — Visual Learning Guide

    Design safe reuse for public product pages, with cache-aside traces, freshness and validation, update races, private-data boundaries, stampede control, independent CDN edges and reasoned practice.

  10. One Server Is Struggling — Visual Learning Guide

    Diagnose saturation before scaling, compare vertical and horizontal capacity, size failure headroom, design ready routing and shared state, and test deployment and autoscaling against downstream limits.

  11. The Database Needs Help — Visual Learning Guide

    Separate replica read scaling, authoritative purchase reads, safe writer failover and historical recovery, then reason through query optimisation, shard locality, skew, global constraints and migration tests.

  12. Does the Customer Have to Wait — Visual Learning Guide

    Move email follow-up outside checkout waiting through durable intent, then reason about acknowledgements, duplicate attempts, idempotent effects, bounded retry, owned dead letters, ordering and queue capacity.

  13. Something Will Fail — Visual Learning Guide

    Contain dependency failure through measured deadlines, safe bounded retries, breakers and resource isolation, then verify truthful degraded outcomes, usable failover capacity and stable recovery.

  14. Two Servers Disagree — Visual Learning Guide

    Define observable consistency and session guarantees, measure stale-version intervals, choose operation-specific partition behavior, and reason about quorum evidence, concurrent merges, fencing and verified repair.

  15. Who Can See and Change This — Visual Learning Guide

    Protect private orders through explicit identity, object and field permissions; reason about session and token lifetimes, revocation, encryption boundaries, secrets, selective logs and controlled refusal tests.

  16. Design Measure Improve — Visual Learning Guide

    Measure customer journeys with well-defined metrics, safe events and traces, then use objectives, controlled workload tests and recovery drills to diagnose limits and verify meaningful design improvements.