Module 91: Introduction to System Design

Lesson 4 of 5 · 15–25 minutes

Trade-offs

🏠The everyday picture

Choosing between a scooter and a car: the scooter is cheap, quick in traffic and easy to park; the car is safer, carries the family and keeps you dry. Neither is "best"; it depends on what matters most for your life.

📘What it really is

# ADR 003: Use a single PostgreSQL database with a unique constraint to prevent double booking
Status: accepted · Date: 2026-11-01
Context: Two students must never book the same slot (NFR-4). Expected load is modest.
Options: (1) database unique constraint + transaction; (2) distributed lock in Redis; (3) separate booking service with queue.
Decision: (1). Simplest, strongly consistent, enough for 100x today's load.
Consequences: booking writes go to one primary database; revisit if writes exceed ~1,000/second.

🖱️Try it

Write three ADRs for the booking platform: how to prevent double booking, whether to build a mobile app or a responsive web app first, and which payment approach to use. For each, list at least two options with their trade-offs and give your decision and its consequences.

✅Quick check

What does an Architecture Decision Record capture?

Show the answer

The context, options, decision and consequences of an important design choice.

Why prefer the simplest design that meets the requirements?

Show the answer

It's cheaper to build, run and change; extra flexibility often serves needs that never come.

← PreviousComponents and C4 diagrams
ProLearners Assist