Books / Learning comic
System Design - Online Shopping
Theme: Computing & AI
Asha and Dev build a small retailer's online shop across sixteen illustrated chapters, using the same £29.99 Desk Lamp to connect abstract system-design ideas to concrete decisions. The journey starts with customer needs, scope and one browser click, then develops a modular application, storage choices, capacity estimates, query performance and safe concurrent purchasing. Search, caching, application scaling, replicas and queues are introduced with their limits rather than as automatic upgrades. Later chapters examine cascading failure, consistency during network partitions, identity and resource-level permissions, and evidence-led operation. Examples repeatedly distinguish a displayed value from authoritative truth, an accepted payment request from verified success, and a backup from proven recovery. Worked traces and closing questions make the collection a coherent introduction to designing, testing and improving dependable software.
Start reading →View in the interactive libraryAbout this book
This comic collection follows Asha and Dev as they design an online shop for one retailer. Product42, a Desk Lamp priced at £29.99, provides an example that links customer journeys to technical decisions. The opening brief includes shoppers and staff, an implementation team, limited time and first-release scope. Performance, correctness and security goals are made testable before technologies are chosen. A browser-click walkthrough then connects DNS, TCP, TLS, HTTP, application routing, database access and the resources needed to render a page. The first architecture assigns clear responsibilities to a modular application, relational records, image storage and an external payment provider. Catalogue, basket and order can remain modules within one deployment. Server-controlled prices, atomic local stock reservation and Pending orders establish purchase boundaries, while verified payment outcomes and stable retry keys address remote uncertainty. A database rollback cannot undo a successful provider charge. Capacity planning adds assumptions, request rates, peak factors, headroom, tail latency, storage and network estimates, always followed by measurement rather than confidence in arithmetic alone. Storage and query chapters connect models to access patterns. Relational references preserve structure and history; documents accommodate varied product shapes; keyed sessions need explicit lifecycle rules; object storage holds bytes with separate permissions. Query diagnosis examines scans, selectivity, plans, statistics, composite indexes, write costs and pagination. The last-lamp race demonstrates why a stock total can hide two accepted orders. Conditional updates, local transactions, row locks and optimistic versions protect business decisions, with explicit conflict handling instead of blind retries or indiscriminate last-write-wins. Discovery and performance layers remain subordinate to authoritative facts. Full-text analysis, inverted indexes, filters and ranking help shoppers find relevant products, while current price and stock are rechecked elsewhere. Caching introduces hits, misses, TTL, validators, invalidation races, safe keys, privacy, stampedes and CDN edges. Application scaling distinguishes larger instances from more peers, addressing readiness, shared state, draining and downstream limits. Database scaling adds replica lag, freshness-sensitive routing, tested failover and the costs of partition keys, hot shards and cross-node work. Replicas never replace protected recovery history. Queues move suitable follow-up off the response path without postponing result-defining correctness. Durable handoff, acknowledgement, duplicate-safe effects, bounded retries and dead-letter ownership keep delayed confirmation separate from a Paid order. Resilience chapters connect deadlines, safe retry, backoff, circuit breakers, resource isolation, admission control and tested failover. Distributed consistency is treated as a promise about visible writes, with session guarantees, partition-specific trade-offs, quorum assumptions, conflicts, fencing and repair. Catalogue browsing may tolerate bounded staleness while stock decisions require authoritative coordination or an honest unavailable response. Security distinguishes identity from permission on an exact resource, then considers sessions, revocation, least privilege, transport protection, secrets, minimal data, safe logs and abuse controls. The final chapter connects metrics, logs and traces to user-facing goals, service indicators, objectives and error budgets. Controlled load tests identify real bottlenecks; incident response protects orders while preserving evidence; restore drills establish recovery time and data boundaries. Worked scenarios and knowledge checks reinforce the collection's habit: choose mechanisms for stated consequences, then verify the journey.
Published chapters
- 01 - Before We Build the Shop
- 02 - The Journey of One Click
- 03 - Our First Working System
- 04 - How Much Is Enough
- 05 - Where Should Everything Live
- 06 - Why Is This Query So Slow
- 07 - Two People Edit the Same Record
- 08 - Finding the Right Product
- 09 - The Same Page a Thousand Times
- 10 - One Server Is Struggling
- 11 - The Database Needs Help
- 12 - Does the Customer Have to Wait
- 13 - Something Will Fail
- 14 - Two Servers Disagree
- 15 - Who Can See and Change This
- 16 - Design, Measure, Improve