What the system must do, and how well it must do it. The first thing to ask in any design.
Functional requirements say what the system must do. Non-functional requirements say how well it must do it.
A requirement is something the system has to do or has to be. We split requirements into two families, because they are used in different ways.
Functional requirements describe behaviour: the features and the rules of the business. If you took one away, a user would say, "I cannot do that any more."
Non-functional requirements (also called quality attributes) describe the qualities of the system: speed, safety, size, and how often it is available. If you took one away, a user would say, "It still works, but it is too slow, too fragile or not safe."
| Quality | The question it answers | Example target |
|---|---|---|
| Performance (latency) | How fast is one request? | p95 under 200 ms |
| Scalability | How much load can it take, and grow to? | 50,000 requests per second at peak |
| Availability | How much of the time is it up? | 99.99% per month |
| Reliability | Does it give the right answer, every time? | No wrong charges |
| Durability | Is stored data ever lost? | No acknowledged write is lost |
| Consistency | Do all users see the same data? | A new post is visible within 5 seconds |
| Security | Who can see or change what? | All data encrypted; every action is logged |
| Maintainability | How easy is it to change and fix? | A fix can be released in under a day |
| Cost | How much may it cost to run? | Under a set amount per month |
| Vague wish | Better requirement |
|---|---|
| It should be fast | 95% of searches return in under 300 ms |
| It should never go down | 99.95% availability each month, with failover in under 60 seconds |
| It must scale | Handle 10 million daily users and 20,000 requests per second at peak |
| It must be secure | Passwords stored with a slow salted hash; all traffic over TLS |
The features stay the same at every level: the user can still upload, follow and search. Only the quality target changes, and so does the bill. The cost scores are made-up teaching numbers.
| Term | Meaning in easy words |
|---|---|
| Requirement | Something the system must do or must be |
| Functional requirement | A feature or behaviour: what the system does |
| Non-functional requirement (NFR) | A quality of the system: how well it works |
| Quality attribute | Another name for a non-functional requirement, such as speed or safety |
| Scope | The list of things that are in the project, and those that are not |
| Latency | How long one request takes |
| Throughput | How many requests per second the system handles |
| Availability | The share of time the system is up and usable |
| Durability | Stored data is not lost, even after failures |
| SLA / SLO / SLI | A promise, a target and a measurement of quality (see the SLA, SLO and SLI topic) |
| Trade-off | Getting more of one quality by accepting less of another |
| Choice | We gain | We lose |
|---|---|---|
| Strict latency target | A snappy product | More caches, more regions and more cost |
| Very high availability | Fewer outages | Extra servers, failover work and complexity |
| Strong consistency | Everyone sees the same data | Higher latency and lower availability in a network split |
| Strong security rules | Safer data | Slower development and more steps for users |
| Low cost | A cheaper bill | Less headroom for spikes and failures |
| Loose targets | Fast and cheap to build | Risk of unhappy users when load grows |