Functional and Non-Functional Requirements
Functional requirements say what the system does; non-functional requirements say how well it must do it. The second kind is harder to write, impossible to verify when vague, and the one that actually decides the database design.
Beginner
Learning objectives
- Classify a requirement as functional, non-functional or a business rule
- Turn a vague quality adjective into a measurable target with a metric, a population and a threshold
- Recognise the four families of non-functional requirements and what each one constrains
- Trace a non-functional requirement to its concrete consequences on the database design
- Recognise and arbitrate conflicts between non-functional requirements
Prerequisites
- Collecting Requirements
Introduction
The previous lesson produced a register in which every row was marked functional, non-functional or business rule. That classification is not bureaucratic labelling: the three kinds of statement are written by different people, verified in different ways, and they fail in different ways.
A functional requirement describes an ability. The system must record a loan. You can demonstrate it: either the loan is recorded or it is not. Its verification is a test case with a clear pass/fail.
A non-functional requirement describes a quality of the system as a whole. A loan must be recorded in under two seconds with four hundred concurrent users. You cannot demonstrate it with a single example; you need a measurement, a load, and a definition of what counts as a violation. Its verification is an experiment.
Functional requirements
Functional requirement
A functional requirement states a behaviour the system must exhibit: an operation it must support, a piece of information it must store, a transformation it must perform, or a condition it must enforce. It is verified by exercising the system and observing the outcome.
Functional requirements come in four recognisable shapes, and it is useful to distinguish them because they end up in different places in the design.
| Shape | Example | Where it ends up |
|---|---|---|
| Data requirement — something must be stored | "For each member the system stores name, fiscal code, e-mail and expiry date" | An entity and its attributes (Module 3) |
| Operation requirement — something must be possible | "The librarian must be able to renew a membership" | A use case; a state change in the data |
| Derivation requirement — something must be computed | "The system must compute the fine as 0.20 € per late day" | A derived attribute, or a computed column, or application logic |
| Rule requirement — something must be prevented | "A member with an overdue loan cannot borrow" | A cardinality, a constraint, a trigger, or application logic |
The fourth shape is the one that most often gets lost. A rule that is written in prose but never translated into a constraint is a rule the system will violate within a month.
Non-functional requirements
Non-functional requirement
A non-functional requirement states a constraint on how the system delivers its functions: how fast, how available, how secure, how much data, for how long, at what cost, on which platform. It is a property of the system as a whole rather than of a single operation, and it is verified by measurement rather than by demonstration.
The definition contains the difficulty. A functional requirement has a natural boundary — this operation, this input, this output. A non-functional requirement does not: "the system must respond in under 300 ms" is a statement about every operation, under every load, forever. That is why vague non-functional requirements are so common and so damaging: they are easy to state and almost impossible to check.
The four families
Almost every non-functional requirement belongs to one of four families. The classification is useful because each family has a characteristic way of being measured and a characteristic way of being forgotten.
| Family | Asks | Typical requirements | How it is verified |
|---|---|---|---|
| Performance and capacity | How fast, how much, how many | Response time, throughput, concurrent users, data volume, growth | Load test, benchmark, measurement in production |
| Reliability and availability | How often may it be down, and what happens to data | Uptime, recovery time, recovery point, backup frequency | Failure injection, restore drill, audit of backups |
| Security and privacy | Who may see and do what, and what must be protected | Authentication, authorisation, audit trail, encryption, retention, anonymisation | Access tests per role, review of the audit log, data-protection audit |
| Operability and maintainability | How is it run, changed, migrated, monitored | Deployment, migration without downtime, monitoring, portability, documentation | Deployment rehearsal, migration test, review of monitoring coverage |
Two smaller families are worth naming because they are frequently confused with the first: usability (how much training a task requires, how many errors users make) and compliance (which regulation, which article, which retention period).
From adjective to target
The core skill of this lesson is a rewriting operation. Every vague quality adjective can be converted into a measurable target by supplying four things:
metric + population + condition + threshold
| Adjective | Rewritten target |
|---|---|
| "fast" | Median response time for a title search below 300 ms, measured over the catalogue of 50 000 titles, at 200 concurrent users |
| "scalable" | The design must remain within the response-time target when the loan table grows from 44 000 to 500 000 rows, i.e. at least ten years of data online |
| "reliable" | The system must be unavailable for less than 4 hours per year, and no committed loan may be lost on failure |
| "secure" | Only users with role librarian may read the fine amounts; every read of a member's fiscal code must be logged |
| "easy to use" | A new librarian must be able to register a loan without assistance after 15 minutes of training, and the error rate on first-week loans must stay below 2 % |
| "maintainable" | A schema change adding one nullable column must be deployable without stopping the service |
| "compatible" | The system must run on MySQL 8.0 or later and must not require extensions unavailable on the organisation's managed instance |
Look at what changed. The adjective was a direction; the target is a decision. "Fast" leaves the designer free to do nothing. "300 ms at 200 users over 50 000 titles" forces a choice: an index on the title, a design that avoids a full scan, and a measurement to prove it.
Where non-functional requirements land in the database
This is the part most courses omit, and it is the reason this lesson exists in a database curriculum. Each non-functional family has direct, concrete consequences on the artefacts you will produce in Modules 3 to 8.
| Non-functional requirement | Concrete design consequence |
|---|---|
| Response time on search | Indexes on the searched columns (Module 7); avoidance of functions on indexed columns; possibly a denormalised column to avoid a join |
| Throughput at peak | Transaction boundaries kept short; no long-running report inside an operational transaction; connection pool sized for the peak |
| Retention for N years | A design that separates current from historical data; an archive table or a partition (Module 7) |
| "No committed data may be lost" | Choice of storage engine, fsync policy, backup and binary log configuration (Module 7) |
| Role-based visibility | Views, column-level grants, or row-level filtering; possibly a tenant_id column on every table |
| Auditability of who changed what | A history table or an audit trigger; this is a structural decision, not a log file |
| Anonymisation after N years | Nullable foreign keys, or a design in which personal data lives in a separate relation that can be purged independently |
| Multi-branch operation | A branch entity and a foreign key on every branch-scoped table — decided in Module 3, not later |
| Portability across DBMS | Avoiding vendor-specific types and features; this constrains Module 7 heavily |
Two of those deserve emphasis because they are frequently discovered too late.
The load profile
Performance requirements are meaningless without a description of the load, and the load of a database is characterised by four numbers that must be collected explicitly.
| Dimension | Question | Why it matters for the design |
|---|---|---|
| Volume | How many rows in each entity, now and in five years? | Index choice, partitioning, archiving |
| Read/write ratio | How many reads per write? | Whether to optimise for writes (few indexes) or reads (more indexes) |
| Access pattern | Which queries dominate? Which columns appear in WHERE and ORDER BY? |
The columns that need indexes |
| Concurrency | How many simultaneous users at peak, and what do they do? | Locking, isolation level, connection pool |
OLTP and OLAP are different systems
One distinction inside the performance family changes the entire design, and it must be made in this phase.
| OLTP (operational) | OLAP (analytical) | |
|---|---|---|
| Typical operation | Register a loan; read one member | Total loans per month per branch |
| Rows touched per query | A handful | Millions |
| Writes | Many, small, concurrent | Few, large, batch |
| Design priority | Short transactions, correct constraints, minimal indexes on write-heavy tables | Denormalisation, pre-aggregation, separate storage |
| Index strategy | Few, precise indexes | Covering indexes, materialised summaries |
| Schema shape | Normalised (Module 6) | Often a star schema |
The practical consequence: if the same database must serve both, the requirements document must say so, because the answer is usually not "make one schema do both" but "extract a copy for analysis". That decision belongs here, not in Module 7.
Conflicts between non-functional requirements
Non-functional requirements conflict with each other far more often than functional ones, because they are properties of the same finite system.
| Conflict | Why | Typical resolution |
|---|---|---|
| Performance vs integrity | Every constraint checked costs time on write | Keep the constraints; they are cheaper than corrupted data. Optimise the query, not the guarantee |
| Performance vs normalisation | Denormalisation removes joins but duplicates facts | Denormalise only where measured, and document the invariant that must now be maintained by code |
| Security vs usability | More checks mean more friction | Risk-based: friction only where the risk is |
| Availability vs consistency | A replica that accepts writes can diverge | Choose per operation; do not let the DBMS choose for you |
| Retention vs privacy | Keeping history helps analysis, keeping personal data creates liability | Separate the fact from the person (see above) |
| Cost vs everything | Storage, replicas and indexes cost money | Make the trade-off explicit, with numbers, and let the owner decide |
Prioritisation: MoSCoW
Not all requirements are equal, and the register must say which are which. The standard classification is:
- Must — the system is not acceptable without it. Failing a Must means failing the project.
- Should — important, painful to omit, but the system is still usable.
- Could — desirable, included only if it costs little.
- Won't (this time) — explicitly excluded, and written down so that nobody assumes it will appear.
The last category is the most valuable and the most neglected. Writing "Won't: integration with the university's student registry, this release" prevents a late-stage surprise and documents a decision that will otherwise be re-litigated every month.
Worked example: the library's non-functional requirements
Continuing the library case from the previous lesson, here is what the non-functional part of the register looks like once the adjectives have been rewritten.
| ID | Requirement | Family | Verification |
|---|---|---|---|
| N1 | A title search must return the first 20 results in under 300 ms, measured on 50 000 titles at 200 concurrent users | Performance | Load test with a generated catalogue |
| N2 | Registering a loan must complete in under 1 s at peak (400 loans/day, 90 % between 10:00 and 12:00) | Performance | Timed test at peak profile |
| N3 | The system must be unavailable less than 4 hours per year during opening hours | Availability | Uptime monitoring over 12 months |
| N4 | No committed loan may be lost on failure; recovery point objective 15 minutes | Reliability | Failure injection; verify binary log and backup interval |
| N5 | Only librarians and the director may read member fiscal codes; every read must be logged | Security | Role test; audit log inspection |
| N6 | Loan records must be kept 5 years; personal data must be anonymised at 5 years while loan statistics survive | Compliance + privacy | Retention job test; inspect a purged row |
| N7 | The system must run on MySQL 8.0 and must not use features unavailable on a managed instance | Operability | Schema review against the target platform |
| N8 | A schema change must be deployable without stopping the service for more than 30 s | Operability | Migration rehearsal on a copy |
Now trace three of them into the design, to see the point of this lesson:
- N1 forces an index on the title column. It also forbids a
WHERE LOWER(title) LIKE '%term%'design if the catalogue grows, because a leading wildcard cannot use a B-tree index — a decision taken in Module 7 that will be much cheaper to take now. - N2 forces the loan registration transaction to be short: no report, no recalculation of statistics inside it. It also suggests that the "current loans" access path is the hot one, and therefore that an index on
(member_id, returned_at)will exist. - N6 forces the schema to separate the personal data of the member from the fact of the loan. Without it, the anonymisation job would have to rewrite history — which is exactly the migration nobody wants.
Common mistakes
| Mistake | Why it hurts | What to do instead |
|---|---|---|
| Leaving adjectives unquantified | Cannot be designed for, cannot be verified, will be declared unmet by whoever is unhappy | Metric + population + condition + threshold |
| Inventing thresholds | Creates requirements nobody approved, with unapproved costs | Take numbers from the organisation; record their source |
| Treating non-functional requirements as "later" | They determine structure (retention, audit, multi-tenancy) | Classify them in this phase and trace each to a design consequence |
| Collecting only the average | The design fails exactly at the peak | Ask for the peak and the worst day of the year |
| Ignoring the read/write ratio | Indexes added for reads slow every write | Collect the load profile explicitly |
| Mixing reporting and operations | Reports hold locks during the working day | Separate the loads; plan a copy for analysis |
| No prioritisation | Everything is a Must, so nothing is | MoSCoW, including an explicit Won't list |
| Silent trade-offs | The decision is re-litigated every month | Write the trade-off with its cost and its motivation |
Summary
- Functional requirements describe abilities and are verified by demonstration; non-functional requirements describe qualities of the whole system and are verified by measurement.
- Non-functional requirements fall into four families — performance and capacity, reliability and availability, security and privacy, operability and maintainability — plus usability and compliance.
- Every adjective becomes usable only when rewritten as metric + population + condition + threshold, with thresholds that come from the organisation rather than from the designer's taste.
- Non-functional requirements have concrete schema consequences: indexes, transaction boundaries, archiving, views, audit tables, anonymisation, and the separation of operational from analytical load.
- They conflict with each other; the resolution and its cost must be recorded, not remembered.
- Prioritisation, including an explicit Won't list, is part of the requirements, because priorities change the design and not only the schedule.
Verification questions
Check your understanding
- Classify each statement: (a) "a member may hold at most five active loans"; (b) "the system must be available during opening hours"; (c) "the system must record the return date of a loan"; (d) "the fine is 0.20 € per late day".
- Why can a non-functional requirement not be verified by a single test case?
- Rewrite "the system must be secure" as two usable requirements.
- A stakeholder asks for a report of all loans per branch, per month, for the last ten years. What two questions must you ask before accepting it?
- Why is the "Won't" category of MoSCoW the most valuable one?
Show the answers
- (a) Business rule, expressed as a functional constraint — it prevents an operation, and it will become a check in the application or a trigger. (b) Non-functional (availability). (c) Functional (data requirement). (d) Functional (derivation requirement) — and note that the value 0.20 € is a business parameter that should live in configuration, not hard-coded.
- Because it is a property of the system as a whole under a specified load: one test case exercises one operation once, while the requirement speaks about all operations under peak concurrency over a year. Verification requires a measurement plan: population, load profile, duration and threshold.
- For example: "only users with the librarian or director role may read a member's fiscal code, and every such read must be recorded in an audit log with user, timestamp and record identifier" (authorisation + auditability); and "data in transit must use TLS 1.2 or later, and member personal data must be anonymised five years after the last loan" (protection + retention). Note that the second pair already has schema consequences.
- (a) How many rows does that scan? Ten years of loans at 44 000 per year is 440 000 rows, and the aggregation is analytical, not operational. (b) How often, and by whom, and how fresh must it be? A monthly report can be pre-computed overnight; a live dashboard cannot. Both answers together decide whether the operational schema can serve it at all.
- Because an unwritten exclusion is a silent assumption that will surface as a defect. Writing it down converts an expectation into a decision, protects the team at acceptance, and — for a database — prevents a schema from being built to accommodate a requirement that was never approved.
Exercise
Quantify a real system
Below are six non-functional requirements as they were actually written by a client. Rewrite each one as a measurable target, and state for each the design consequence you would expect on the database.
- "The site must be fast even when there are many users."
- "We must never lose a booking."
- "The customer service must be able to see everything about a customer."
- "Old data must not slow the system down."
- "The system must be ready for GDPR."
- "It must work on our existing server."
For at least two of them, state what you would have to ask the client because the number cannot be invented.
Show the commented solution
1. "Fast even when there are many users."
Target: "a booking search must return the first 20 results in under 400 ms at 500 concurrent users over 200 000 bookings". Consequence: an index on the search columns, a bounded result set (LIMIT), and a decision to avoid leading-wildcard searches. To ask: how many users at peak, and what does "fast" mean to the person who wrote this — a second, or a tenth of a second?
2. "We must never lose a booking." Target: "a booking confirmed to the customer must survive a server failure; recovery point objective 0 for confirmed bookings, 5 minutes for in-progress ones". Consequence: a transactional storage engine with durable commits, a write-ahead log configuration that does not trade durability for speed, and a tested restore procedure. To ask: what is a booking worth if it is lost — is the customer told immediately? The answer decides how much durability is worth paying for.
3. "Customer service must see everything about a customer." This one is dangerous as written: "everything" conflicts with data minimisation and with the security requirement that fiscal codes be restricted. Target: "customer-service role may read the customer's orders, contacts and open tickets, but not payment card data or fiscal codes; every access is logged". Consequence: views or column-level grants, and an audit table. To ask: everything — including the data the privacy policy says we must not show?
4. "Old data must not slow the system down." Target: "queries on current data must not degrade as history grows; data older than 5 years must be moved to an archive table, and the archive must remain queryable for legal requests within 24 hours". Consequence: a partition or an archive relation, and a purge job — a structural decision, not an index. To ask: how far back do operational queries need to see, and how quickly must archived data be retrievable?
5. "Ready for GDPR."
Target: three separate requirements — "personal data must be exportable for one subject within 30 days"; "personal data must be erasable on request, except where a legal retention obligation applies"; "access to personal data must be logged". Consequence: the ability to find all rows belonging to one person (which usually means a subject_id reachable from every table that holds personal data), and a design in which legal retention and erasure do not contradict each other. To ask: which retention obligations override erasure, and for which data?
6. "It must work on our existing server." Target: "the schema must run on MySQL 8.0.32 on a 4-core, 16 GB instance, with the existing 200 GB of storage, and must not use features unavailable in the managed service". Consequence: no vendor-specific extensions, a review of every type and feature against the target platform, and a realistic capacity calculation. To ask: who administers the server, and may we upgrade the DBMS minor version?
The general lesson. Every one of the six original sentences hides a number and a decision. In four of them, the number belongs to the client. In one (3), the sentence is not merely vague but in conflict with another requirement — and the conflict must be surfaced, not silently resolved by the designer. In one (6), the constraint is real and technical, and it constrains Module 7 rather than Module 3.
Where to go next
- The previous lesson, on how these requirements are actually extracted from people: Collecting Requirements.
- Why the independence between logical and physical design matters when requirements change: Logical and Physical Data Independence.
- The functions a DBMS must provide for these requirements to be satisfiable at all: Database Management Systems.
- The complete map of the process, and which phase consumes each artefact: The Phases of Database Design.
- A worked example of a schema that already reflects its requirements: Student and Course.