Chapter 01
Start with the operation and its promises
Replace a vague architecture request with a small set of behaviours that can be tested.
- Separate functional behaviour from quality goals
- Name assumptions and exclusions
- Write an invariant and a failure story
A design begins with a user doing something
“Design a learning platform” is too broad to evaluate. Choose an operation such as saving a learner’s lesson completion. Describe who may call it, what data it accepts, the durable result, and what a successful response promises. Then describe reading that result. A system can accept a write quickly and still disappoint the learner if the next page immediately forgets it.
Functional requirements describe behaviour, while quality goals describe properties such as latency, availability, security, recoverability, and cost under stated conditions. They influence one another. A requirement to preserve an acknowledged answer through a machine loss changes storage and replication decisions. A desire for low latency alone does not explain whether stale progress is acceptable.
Go deeper: [3] Service level objectives · [1] HTTP semantics RFC 9110
Write a contract that exposes disagreement
An invariant is a condition that must remain true, such as “one learner cannot read another learner’s private progress.” It is stronger and more testable than a feature label like “secure accounts.” For every important invariant, identify where it is enforced and what happens when two operations race or a dependency fails.
Record assumptions beside the design: expected traffic, data retention, supported clients, team size, and the kinds of failures being considered. Explicitly exclude features that would change the problem, such as worldwide write availability or anonymous public uploads. Exclusions are not excuses; they prevent a reasonable small design from being judged against a different, unstated system.
Worked example · A first progress-save contract
- Caller: an authenticated learner. Input: an existing lesson identifier and a completion request.
- Effect: record completion once for that learner and lesson. The response reflects the committed result under the chosen write contract.
- Failures: reject invalid or unauthorized input; after a timeout the caller may not know whether the effect committed, so repeated requests need a defined meaning.
Result: You can now evaluate an API, schema, and retry strategy against the same promise.
Go deeper: [9] PostgreSQL 18 constraints · [7] Data integrity
Keep these ideas
- Start with an observable operation and its promises.
- State invariants and exclusions before choosing components.
Practise before moving on
Try each task before opening the solution. Explain your reasoning, including a boundary or failure case.
1.1 · Practice task
Rewrite “the system should be reliable and secure” as two concrete requirements for progress saving.
Hint: Name the operation, actor, measurement, and boundary.
Read the worked solution1.2 · Practice task
A reviewer asks for global active-active writes after you propose a single-Region service. What should change in the discussion?
Hint: Treat it as a changed requirement, not a missing logo.
Read the worked solution