System DesignVol. 12 · Part XII
0 / 0

Shelves / System Design

SD·121

Requirement Analysis

The step that decides whether a design succeeds: why requirements come before boxes, a repeatable design method, discovering users, workflows, core operations and edge cases, writing functional requirements as use cases and API sketches, the full catalogue of non-functional requirements (latency, throughput, availability, durability, consistency, security, compliance, cost, maintainability, and more) expressed as measurable targets and SLOs, constraints and assumptions, prioritisation and trade-offs, architecture decision records, and two fully worked examples.

36 topics · ~20 min read · 29-question quiz
Updated Suggest a correction

Start here: turning a wish into requirements you can test

Requirements usually arrive as wishes: "customers should be able to order", "it must be fast", "we can't lose orders". A designer's first job is to turn each wish into a statement precise enough that you could test it. If you can't say how you'd check a requirement, you can't design for it either.

From wish to requirement

Wish Requirement you can test
"it must be fast" p99 order latency under 50 ms at 100 orders per second
"we can't lose orders" once the API returns 201, the order survives a process crash
"don't charge twice" two requests with the same Idempotency-Key create exactly one order
"it should always work" 99.9% of requests succeed in each 30-day window

Each now names a measure (p99, survival, count), a threshold, and the conditions (at what load, under which failure).

Requirements as checks

Those first three were written as an automated script and run against two versions of the orders service. Version 1 kept orders in a Python list; version 2 stored them in a database with a unique idempotency key:

Text
== v1 (in-memory list)
  FAIL  NFR-1 retry creates one order   2 orders created by 2 identical requests
  FAIL  NFR-2 orders survive a crash    2 before crash, 0 after restart
  PASS  NFR-3 p99 < 50 ms at 100/s      p50=0.76 ms  p99=3.63 ms
== v2 (database + idempotency key)
  PASS  NFR-1 retry creates one order   1 order created by 2 identical requests
  PASS  NFR-2 orders survive a crash    1 before crash, 1 after restart
  PASS  NFR-3 p99 < 50 ms at 100/s      p50=2.59 ms  p99=9.09 ms

Version 1 was fast and wrong: it met the only requirement anyone would have demoed, and failed the two that matter most to the business. Version 2 met all three, at a price: p99 rose from 3.6 ms to 9.1 ms, because writing each order safely to disk takes time. That is a trade-off, and the requirement (under 50 ms) says it's an acceptable one.

The questions that find hidden requirements

Most missing requirements come from not asking:

  • Who uses it, and how many? (customers, kitchen staff, delivery riders, support)
  • What happens when it fails? (payment provider down, a server dies, a duplicate request)
  • What must never happen? (lost order, double charge, someone else seeing your address)
  • How big, how fast, how long? (orders per day, peak, data kept for how many years)
  • What are we not doing? (no table bookings this year: write it down)

How deep to go in requirement analysis

Volume 17 defines six mastery levels. For this chapter they look like this; the chapter aims at L3 everywhere, and its lab at L4.

Level What you can do
L1 Distinguish functional and non-functional requirements and constraints
L2 Write testable requirements with measures, thresholds and conditions for a feature
L3 Elicit users, workflows, edge cases and quality attributes systematically and prioritise them
L4 Find missing or conflicting requirements and turn requirements into automated checks
L5 Lead requirement discovery for a whole system and record trade-off decisions (ADRs)
L6 Set requirement and architecture-decision practice across an organisation

Why requirements come first

The most expensive mistake in system design isn't choosing the wrong database; it's solving the wrong problem. A design optimised for 10 million users that will only ever have 2,000, or a design that ignores a legal requirement to keep data in the EU, fails no matter how elegant the boxes are.

Before drawing anything, you need to know:

  1. What the system must do (functional requirements): who uses it, for which workflows, through which operations, including the awkward edge cases.
  2. How well it must do it (non-functional requirements, also called quality attributes or "-ilities"): how fast, how available, how durable, how consistent, how secure, how cheap, how changeable.
  3. What constrains the solution: budget, deadlines, team skills, existing systems, regulations, technology mandates.

Requirements drive architecture: the non-functional requirements in particular determine most structural decisions. "Store and retrieve user profiles" can be built a hundred ways; "p99 read latency under 20 ms for 50,000 reads/s across three continents with data residency in the EU" narrows the options dramatically.

A repeatable design method

Whether you're in a design review at work or a 45-minute interview, the same sequence works:

①require-ments ②estimatescale ③API +data model ④high-leveldesign ⑤deepdives ⑥bottleneck+ failure ⑦ops, costevolution iterate: new findings change requirements and estimates spend ~20% of the time on ①–② · it decides the other 80%
A repeatable system design method. Clarify functional and non-functional requirements first; estimate scale; define the API and data model; sketch the high-level architecture; deep-dive into the riskiest components; then address bottlenecks, failure modes, security, operations and evolution. Each step feeds back into earlier ones as you learn.

This chapter covers step ①; chapter 122 covers ②; chapters 123–134 provide the material for ③–⑦; the case-studies chapter applies the whole method end to end.

Functional requirements

Users and actors

Start with who interacts with the system, human and machine:

  • End users, often in several roles (buyer, seller, guest, administrator, support agent, moderator).
  • Internal operators (finance, compliance, operations teams with back-office tools).
  • External systems (payment providers, partners calling your API, webhooks, identity providers, data warehouses consuming your events).
  • Scheduled processes (nightly billing, report generation, data retention jobs).

For each actor, ask: what are they trying to achieve, how often, from which devices and locations, and with what expectations (a merchant integrating via API expects stability and documentation; a mobile user expects instant feedback on flaky networks).

Workflows

A workflow (user journey) is a sequence of steps that achieves a goal: "a rider requests a trip, is matched with a driver, the driver arrives, the trip happens, payment is collected, both rate each other". Map the important ones end to end, including:

  • Triggers (user action, time, external event).
  • State transitions (an order goes CREATED → PAID → SHIPPED → DELIVERED, or CANCELLED, REFUNDED). Drawing the state machine early reveals missing requirements ("can a shipped order be cancelled?").
  • Who performs each step and what they see.
  • Synchronous vs asynchronous expectations: must the user wait for a result, or is "we'll notify you" acceptable? This one question changes architectures more than almost any other.

Core operations

Reduce workflows to core operations: the verbs the system must support, each with inputs, outputs and access rules. A useful check is CRUD+search+notify for each entity, then the domain-specific operations:

Operation Actor Input → output Frequency Notes
Shorten URL User/API client long URL, optional alias → short code ~100/s Alias uniqueness; abuse (spam, malware)
Resolve short URL Anyone code → HTTP 301/302 redirect ~10,000/s Read-heavy; latency-critical
View click stats Owner code, time range → counts by day/country ~10/s Can be eventually consistent
Delete link Owner/admin code → OK Rare Caches must be invalidated

Frequencies don't need to be precise yet; their ratios (here 100:1 reads to writes) already shape the design.

Edge cases

Edge cases are where real systems spend much of their complexity, and where designs that look clean on a whiteboard break:

  • Concurrency: two users booking the last seat; double-clicking "Pay"; editing the same document.
  • Failure midway: payment captured but order creation fails; email sent but transaction rolled back.
  • Retries and duplicates: the client times out and retries (needs idempotency, Vol. 5 ch. 74).
  • Ordering: events arriving out of order; a "delete" processed before the "create".
  • Limits and abuse: very large inputs, bots, scraping, spam, fraud, denial of service.
  • Time: time zones, daylight-saving transitions, leap years, clock skew, expiry, scheduled actions while the system is down.
  • Lifecycle: account deletion (and the right to erasure), data retention, migration of existing data, deprecated features.
  • Partial availability: what does the product do when the recommendation service is down? (Graceful degradation, chapter 130.)
  • Internationalisation: currencies and rounding, character sets, right-to-left text, local regulations.
  • Hot spots: the celebrity with 100 million followers; the flash sale; the viral link.

Write the important ones down as explicit requirements ("a payment must never be captured twice for the same order, even under retries") because they become constraints on the design.

Capturing functional requirements

Forms that work well in practice:

  • User stories with acceptance criteria: "As a seller, I want to schedule a price change so that sales start at midnight. Given…, when…, then…".
  • Use cases with main and alternative flows.
  • API sketches: writing the endpoints or RPCs early forces precision about inputs, outputs and errors.
HTTP
POST /v1/links                     → 201 { "code": "aZ3kP9", "shortUrl": "https://sho.rt/aZ3kP9" }
  { "url": "https://example.com/very/long/path", "alias": null, "expiresAt": null }
GET  /{code}                       → 302 Location: <long url>     (404 if unknown, 410 if expired)
GET  /v1/links/{code}/stats?from=2026-10-01&to=2026-10-24  → 200 { "byDay": [...], "byCountry": [...] }
DELETE /v1/links/{code}            → 204
  • Out of scope list: equally important. "No custom domains in v1", "no real-time analytics" prevents scope creep and lets the design stay simple.

Non-functional requirements

Non-functional requirements (NFRs) describe qualities of the system. The single most important rule: make them measurable. "Fast" and "highly available" are wishes; "p99 under 200 ms at 5,000 req/s" and "99.95% monthly availability" are requirements you can design for and verify.

Latency

How long operations take, measured as percentiles (p50, p95, p99, p99.9), per operation, from a defined point of view (server-side vs end-user, which network):

  • Interactive user actions: roughly 100 ms feels instant, ~1 s keeps flow, >10 s loses attention.
  • Page loads and Core Web Vitals (Largest Contentful Paint under 2.5 s) for web front ends.
  • Internal service calls usually need far tighter budgets, because one user request fans out into many.
  • Latency budgets: allocate the end-to-end target across hops (gateway 5 ms, auth 5 ms, service 30 ms, database 20 ms…), which shows early whether a design can meet it.

Physics matters: light in fibre covers about 200 km per millisecond, so a round trip between Mumbai and Frankfurt (~6,500 km straight line, longer by cable) costs on the order of 100+ ms no matter how fast your code is. Global latency targets force regional deployments (chapter 134).

Throughput

Operations per unit time the system must sustain: requests/s, messages/s, MB/s, transactions/s, at average and peak, with growth projections. Specify per operation (reads vs writes differ by orders of magnitude) and include batch workloads (a nightly job processing 500 million rows in under 2 hours is a throughput requirement).

Availability

The fraction of time (or of requests) the system serves correctly. Expressed as an SLO over a window:

Availability Downtime per year Per 30-day month Per week
99% ("two nines") 3.65 days 7.2 h 1.68 h
99.9% 8.77 h 43.2 min 10.1 min
99.95% 4.38 h 21.6 min 5.04 min
99.99% 52.6 min 4.32 min 1.01 min
99.999% 5.26 min 25.9 s 6.05 s

Each extra nine costs roughly an order of magnitude more effort: redundancy at every layer, automated failover, multi-region, extremely careful deployments. Choose per user journey (checkout at 99.95%, recommendations at 99.5%), and remember availability multiplies across serial dependencies (chapter 125). Define what counts as "available" (successful responses within a latency threshold, measured where?). SLIs, SLOs and error budgets are covered in Vol. 9 ch. 102.

Durability

The probability that data, once acknowledged, is not lost. Distinct from availability: a system can be down (unavailable) without losing data, or up while silently having lost data.

  • Expressed as an annual probability of loss per object (Amazon S3 is designed for 99.999999999%, "eleven nines") or as RPO (recovery point objective: how much recent data may be lost in a disaster, e.g. "RPO ≤ 1 minute") and RTO (recovery time objective: how long restoration may take).
  • Drives replication (synchronous vs asynchronous), backups, cross-region copies, and immutable/versioned storage against accidental or malicious deletion.

Consistency

What readers are guaranteed to see after writes (Vol. 5 ch. 69–70, chapter 129):

  • Must a user see their own write immediately (read-your-writes)?
  • Must all users see the same value at the same time (linearizability), or is a delay of seconds acceptable (eventual consistency)?
  • Which invariants must never be violated (no overselling inventory, no negative balance, unique usernames)? Those require coordination or careful design; everything else can usually relax.

State consistency per data type: "account balances: strongly consistent; like counts: eventually consistent within 10 s; search index: within 1 minute".

Scalability and elasticity

How the system copes with growth (users, data, traffic) and with variation (daily peaks, spikes). Specify growth assumptions ("10× users in 2 years", "data grows 2 TB/month") and elasticity needs ("handle 5× normal traffic during sales within 2 minutes").

Security

Usually expressed as requirements derived from threat modelling (Vol. 10 ch. 113):

  • Authentication methods (SSO, passkeys, MFA for admins), authorisation model (roles, tenant isolation), encryption in transit and at rest, key management, secrets handling.
  • Audit logging requirements (who did what, retained how long).
  • Abuse prevention: rate limiting, bot protection, fraud checks.
  • Vulnerability management, penetration testing cadence, supply-chain controls.

Compliance and privacy

Legal and contractual obligations that constrain architecture:

  • Data protection: GDPR (EU), India's DPDP Act 2023, CCPA/CPRA (California), and others: lawful basis, consent, data minimisation, right to access and erasure, breach notification.
  • Data residency/sovereignty: data about certain users must be stored and processed in specific jurisdictions (chapter 133, 134).
  • Industry standards: PCI DSS (card data), HIPAA (US health data), SOC 2 and ISO 27001 (security controls), SOX (financial reporting), RBI and other financial regulators' rules, accessibility law (WCAG conformance, the European Accessibility Act in force since June 2025).
  • Retention: keep records for N years (financial), but delete personal data when no longer needed: these can conflict, so design data lifecycles explicitly.

Compliance often shapes the design more than performance: "card numbers never touch our servers" (use a payment provider's hosted fields and tokens) removes most of PCI scope.

Cost

A requirement, not an afterthought: budget per month, cost per transaction or per active user, and the trade-off curve (a second region doubles some costs for better availability). Cloud cost drivers: compute hours, storage volume and class, data transfer (cross-AZ, cross-region and internet egress are frequent surprises), managed service premiums, observability volume, and licences. FinOps practices are in Vol. 7 ch. 91.

Maintainability, operability and evolvability

How cheaply the system can be changed, run and understood:

  • Maintainability: modularity, clear ownership boundaries, test coverage, readable code, documented decisions.
  • Operability: deployability (frequency, rollback time), observability, runbooks, automation, on-call load.
  • Evolvability: how easily you can add features, change schemas, swap components (API versioning, contract tests, loose coupling).
  • Team fit: a design that requires skills the team doesn't have, or more services than the team can own, is a bad design for that team (Conway's law: systems mirror the communication structures of the organisations that build them).

Measurable forms: deployment frequency, lead time for changes, change failure rate, time to restore (the DORA metrics), onboarding time for a new engineer, time to add a new payment method.

More quality attributes

Attribute Example requirement
Usability / accessibility WCAG 2.2 AA conformance; usable on low-end Android devices over 3G
Portability Runs on any Kubernetes; no single-cloud lock-in for the data layer
Interoperability Exposes OpenAPI; accepts ISO 20022 payment messages
Observability Every request traceable end to end; business KPIs on dashboards
Testability Each service testable in isolation with contract tests
Recoverability Point-in-time restore to any second in the last 14 days
Data quality No duplicate customer records; addresses validated
Sustainability Prefer regions with lower carbon intensity for batch work
Localisation 12 languages, 30 currencies, local tax rules

Turning NFRs into targets

A simple template turns vague wishes into designable targets: for [operation/scope], [metric] must be [threshold] under [conditions], measured [how].

Vague Measurable
"Fast checkout" "Checkout API p99 ≤ 400 ms server-side at 2,000 req/s peak, measured at the load balancer"
"Highly available" "Order placement succeeds for ≥ 99.95% of valid requests per 30-day window"
"Never lose orders" "RPO = 0 for confirmed orders (synchronous replication across 2 AZs); RTO ≤ 15 min"
"Secure" "All admin access via SSO with phishing-resistant MFA; audit log of all data exports retained 1 year"
"Scalable" "Support 3× current peak without architectural change; 10× with planned sharding"
"Cheap" "Infrastructure cost ≤ ₹2 per 1,000 link redirects"

Constraints and assumptions

Constraints are non-negotiable limits on the solution space:

  • Technical: must run on the company's Kubernetes platform; must use the existing identity provider; must integrate with a mainframe via files.
  • Organisational: three engineers, six months; the team knows Java and Postgres.
  • Business: launch before a regulatory deadline; budget cap.
  • Legal: data residency, licensing restrictions (no AGPL in distributed products, for example).

Assumptions are things you believe but haven't verified ("traffic is 80% from India", "users tolerate 5 s for report generation"). Write them down: they're risks, and validating the riskiest ones early (a spike, a load test, a conversation with the business) is cheap insurance.

Prioritising and trading off

Quality attributes conflict: consistency vs availability and latency (CAP/PACELC, Vol. 5 ch. 70), security vs usability, cost vs availability, flexibility vs simplicity, time-to-market vs everything. You can't maximise all; you must rank them for this system:

  • MoSCoW (must/should/could/won't) for functional scope.
  • Quality attribute scenarios (from the SEI's ATAM method): stimulus, environment, response, response measure: "when a zone fails (stimulus) during peak (environment), order placement continues (response) with < 1 minute of errors (measure)". Rank scenarios by business importance and technical risk.
  • Utility tree: quality attributes → refined attributes → scenarios with priorities; the high-importance, high-difficulty ones get deep dives.

Be explicit about what you're not optimising: "we accept eventual consistency for analytics to keep the write path fast and cheap".

Recording decisions

Requirements and the decisions they drive should be written down where the team will find them:

  • Design documents (RFCs): context, goals and non-goals, requirements, proposed design, alternatives considered, risks, rollout plan, open questions.
  • Architecture Decision Records (ADRs): short, immutable records of one decision each.
Markdown
# ADR-014: Use PostgreSQL with logical partitioning for click events

Status: Accepted (2026-10-24)

## Context
Click events: ~10k/s peak, retained 13 months, queried by link and day.
Team operates PostgreSQL already; no Cassandra/ClickHouse expertise.

## Decision
Store raw clicks in Kafka; aggregate per link per hour into PostgreSQL tables
partitioned by month. Raw events go to object storage (Parquet) for ad-hoc analysis.

## Consequences
+ Uses existing skills and backups; cheap.
- Real-time per-click queries not supported (hourly granularity).
- Revisit if peak exceeds 50k/s or per-click analytics becomes a requirement.

ADRs make trade-offs visible to future engineers ("why didn't they use X?") and make revisiting decisions a deliberate act.

Worked example: a URL shortener

Functional: create short links (random or custom alias, optional expiry); redirect; per-link click statistics by day and country; delete links; API for programmatic creation. Out of scope v1: custom domains, QR codes, team accounts.

Edge cases: alias collisions; malicious URLs (phishing/malware) must be blocked; redirect loops (shortening our own short URLs); expired links return 410; deleted links stop redirecting within 1 minute globally; bots inflating click counts.

NFRs:

Quality Target
Redirect latency p99 ≤ 50 ms server-side; served close to users
Redirect availability 99.99% (links are embedded in printed material and emails: breaking them is very visible)
Creation availability 99.9%
Durability Created links never lost (RPO ≈ 0)
Consistency A new link redirects within 1 s; stats eventually consistent within 5 min
Scale 100 M new links/month; 10 B redirects/month; peak 10× average
Security Abuse detection; rate limits on creation; links unguessable enough to prevent enumeration of private links
Cost Redirects must be very cheap at scale (cache/CDN-heavy)

Insight from requirements alone: the system is extremely read-heavy (100:1), latency- and availability-critical on reads, tolerant of eventual consistency on analytics, so the design will centre on caching/edge serving for redirects, a simple durable key-value store for links, and an asynchronous pipeline for clicks. Chapter 122 puts numbers on this; the case-studies chapter completes the design.

Worked example: a food-delivery ordering platform

Actors: customers (mobile/web), restaurants (tablet app), delivery partners (mobile app with GPS), support agents, finance, payment provider, maps provider.

Core workflows: browse restaurants near me → build cart → checkout and pay → restaurant accepts/rejects → partner assigned → pick-up → live tracking → delivery → rating; plus cancellations and refunds; restaurant menu management; partner shifts and payouts.

Key edge cases: restaurant doesn't respond in 3 minutes (auto-cancel and refund); item becomes unavailable after payment; partner app loses connectivity; payment succeeds but the app crashes before confirmation (idempotent order creation, reconciliation with the provider); surge at 1 pm and 8 pm; monsoon-day spikes; promotions abuse.

NFRs (selected):

  • Order placement: 99.95% availability, p99 ≤ 800 ms (includes payment authorisation).
  • Location updates: 200,000 partners × one update every 5 s = 40,000 writes/s; tolerate loss of individual updates (latest position matters, not history), but tracking must be within 10 s of reality.
  • Menus and restaurant listings: read-heavy, cacheable, staleness up to a few minutes acceptable except for "restaurant closed" (≤ 30 s).
  • Payments: exactly-once effect (no double charges), full audit trail, PCI scope minimised via the provider's tokenisation.
  • Compliance: DPDP Act for personal data, tax invoicing rules, data retention for financial records.
  • Cost: infrastructure cost per order under a fixed budget.

Different parts of one product have very different requirements: that's the cue to separate them into components with different storage and consistency choices (strongly consistent orders and payments; eventually consistent, cache-heavy catalogue; high-write, loss-tolerant location stream).

Lab: requirements as executable checks

Two versions of a Python orders service on the lab machine (v1 stores orders in a list; v2 in SQLite with a unique idem column), a Python script that encodes three non-functional requirements as checks, and k6 1.3.0 for load.

Experiment 1: the checks

Python
# NFR-1: a retried order request (same Idempotency-Key) creates exactly one order
before = count(); key = str(uuid.uuid4()); post(key); post(key); after = count()
assert after - before == 1

# NFR-2: an accepted order survives a process crash
n = count(); proc.send_signal(SIGKILL); proc.wait(); proc = start(); assert count() == n

# NFR-3: p99 order latency < 50 ms at 100 orders/s for 10 s
thresholds: { http_req_duration: ['p(99)<50'] }      # k6, constant-arrival-rate 100/s
Text
== v1
  FAIL  NFR-1 retry creates one order    2 orders created by 2 identical requests
  FAIL  NFR-2 orders survive a crash     2 before crash, 0 after restart
  PASS  NFR-3 p99 < 50 ms at 100/s       p(50)=756.57µs p(99)=3.63ms
== v2
  PASS  NFR-1 retry creates one order    1 orders created by 2 identical requests
  PASS  NFR-2 orders survive a crash     1 before crash, 1 after restart
  PASS  NFR-3 p99 < 50 ms at 100/s       p(50)=2.59ms p(99)=9.09ms

SIGKILL is deliberate: it gives the process no chance to flush or shut down cleanly, which is what a power cut, an out-of-memory kill or a node failure does. A check using SIGTERM would let a well-behaved service save its state and could pass a design that loses data in a real crash.

Experiment 2: the cost of each requirement

Version Idempotent Durable p50 p99
v1 list in memory no no 0.76 ms 3.63 ms
v2 SQLite, commit per order yes yes 2.59 ms 9.09 ms

Durability isn't free: every order now waits for a commit to reach the disk. Requirements are what tell you whether a cost is acceptable. Under a 50 ms target, v2 has more than 5× headroom; under a hypothetical 5 ms target, you would need group commit, a faster disk, or a different design (accept the order into a replicated log and write it to the database asynchronously). Writing the threshold down is what turns "it feels slower" into a decision.

Experiment 3: requirements that conflict

Two requirements a stakeholder might state together:

  • "An order confirmation is shown within 200 ms."
  • "An order is confirmed only after the payment provider approves it."

The payment provider's own p99 is 1.2 s (from its documentation, say). Both can't hold. The resolution is a design choice that changes the requirement's wording: confirm receipt within 200 ms ("Order received, waiting for payment"), and payment asynchronously, with the kitchen starting only after approval. Finding such conflicts early, with numbers, is the point of requirement analysis; finding them in production is an incident.

Try it yourself

  1. Add NFR-4, "no customer can read another customer's order", as a check, and make v2 fail it, then pass.
  2. Change v2 to commit every 50 ms in a batch (group commit). Measure p99 and decide how NFR-2's wording must change.
  3. Write an architecture decision record (context, decision, consequences) for "SQLite now, PostgreSQL at 10× scale".
  4. For a system you work on, take its three most-repeated wishes and rewrite them as checks like these.

Revision sheet: requirement analysis

Key ideas

  • Requirements before boxes: users, workflows, core operations, scale, failure behaviour and invariants decide the design.
  • Functional (what it does: use cases, API sketches), non-functional (how well: latency, throughput, availability, durability, consistency, security, privacy, cost, operability), constraints (fixed: budget, regulation, existing systems, team).
  • Testable NFRs name a measure, a threshold and conditions; write them as checks where you can.
  • Ask about failure and "must never happen" to find hidden requirements (idempotency, durability, isolation).
  • Scope: explicit non-goals; prioritise (must/should/could, or by risk and value).
  • Conflicts are resolved by design choices that change wording (receipt vs payment confirmation), recorded in ADRs.
  • A repeatable method: requirements → estimates → API and data model → high-level design → deep dives → failure modes → evolution.

Numbers to remember

  • Lab: in-memory v1 passed latency (p99 3.6 ms) but failed idempotency and durability.
  • Lab: durable, idempotent v2 had p99 9.1 ms, within a 50 ms requirement.
  • 86,400 seconds in a day; peak is commonly 2–10× average.

Pitfalls

  • Designing before asking about scale, failure and invariants.
  • Untestable NFRs ("fast", "secure", "scalable").
  • Testing durability with a graceful shutdown instead of a hard kill.
  • Gold-plating for scale nobody asked for.
  • Unrecorded trade-offs that later look like mistakes.

Glossary

  • Use case: a goal-directed interaction between an actor and the system.
  • Quality attribute: a non-functional property such as availability or latency.
  • Invariant: a condition that must always hold (no double charge).
  • ADR: architecture decision record (context, decision, consequences).
  • Non-goal: scope deliberately excluded.