Sub topic 1
Why Requirements Come Before Design
Prerequisites
Assume you understand client-server applications, web APIs, databases, caching, and basic Python. This chapter focuses on turning vague goals into testable system requirements before choosing components.
Why requirements come before design
A design is a set of technical decisions made to satisfy requirements. Without clear requirements, teams may optimize the wrong property, miss important users, or disagree about what “done” means. Requirements also expose trade-offs early. For example, stronger consistency can increase latency or reduce availability during network failures.
Functional requirements: what the system does
A functional requirement describes behavior the system must provide. It should identify an action and an observable result.
Examples for a URL shortener include:
- A user can submit a long URL and receive a short URL.
- Requesting the short URL redirects the client to the long URL.
- A user can delete a short URL they created.
These requirements describe capabilities, not implementation. They do not require a particular database, programming language, or deployment model.
Non-functional requirements: how well it does it
A non-functional requirement describes a quality attribute or constraint. Write it measurably:
- “99% of redirects complete in under 100 ms at the service edge.”
- “Redirects succeed for 99.9% of requests during a 30-day window.”
- “An acknowledged URL is never lost.”
Terms such as latency, availability, and durability are useful only when their measurement method and target are stated.
Eliciting requirements from stakeholders
Interview the people who use, operate, support, secure, and pay for the system. Ask what they need, what can fail, and how they will measure success. Record disagreements instead of silently choosing one interpretation.
Actors, use cases and user stories
An actor is a person or external system that interacts with your system. A use case describes an actor’s goal and the system’s responses. A user story gives the same idea in a compact form:
“As a URL owner, I want to delete my short URL so that it no longer redirects.”
List normal flows, failures, permissions, and important edge cases.
Setting scope, assumptions and constraints
Scope states what the system includes. Out-of-scope items prevent accidental expansion. Assumptions are facts used for estimates, such as expected users or traffic. Constraints are limits you cannot freely change, such as a required cloud provider, budget, regulation, or existing database.
Exercise
Classify “99.9% of redirects succeed over 30 days.”
Show answer
It is a non-functional availability requirement because it specifies how reliably the system performs a function over a defined period.