Functional and Non-Functional Requirements
The difference between what a system does and how well it does it, how to make quality attributes measurable, and how NFRs drive architecture decisions.
What it is
- Functional requirements (FRs) describe behaviour: "a customer can pay with a saved card", "a seller can upload 500 products via CSV".
- Non-functional requirements (NFRs), also called quality attributes, describe properties: availability, latency, throughput, scalability, durability, security, privacy, compliance, operability, maintainability, cost.
Functional requirements decide what components exist. NFRs decide how those components are built, deployed and connected. Two systems with identical features can have completely different architectures because one needs 99.99% availability across regions and the other is an internal tool used by 50 people.
Making NFRs measurable
A vague NFR cannot be designed for or tested. Use the quality attribute scenario format: source, stimulus, environment, artifact, response, response measure.
| Vague | Measurable |
|---|---|
| "The site must be fast" | p95 product page server time < 200 ms, p99 < 500 ms at 5,000 RPS |
| "Highly available" | Checkout SLO 99.95% monthly success rate; max 22 minutes of unavailability per month |
| "Secure" | All PII encrypted at rest with customer-managed keys; OWASP ASVS level 2; pen test before go-live |
| "Scalable" | Handle 10× normal peak for 2 hours during sales without manual intervention |
| "No data loss" | RPO = 0 for orders and payments; RPO ≤ 15 min for catalog |
[!FACT] SLI, SLO, SLA An SLI is a measured indicator (for example, the share of requests under 300 ms). An SLO is the internal target for that indicator. An SLA is a contractual promise to customers, usually looser than the SLO, with penalties.
Real-world example
A bank's mobile app shows balances and allows transfers. FRs are similar to any fintech app. The NFRs (regulatory audit trail, RPO = 0 for ledger postings, strong customer authentication, 24×7 availability, data residency in-country) drive a design with a synchronous replicated ledger database, immutable audit logs, active-passive regional DR inside the same country, and an HSM-backed key hierarchy.
How NFRs drive the architecture
flowchart TB NFR1[Availability 99.99%] --> D1[Multi-AZ + multi-region,<br/>no single points of failure] NFR2[p99 latency < 100 ms] --> D2[Caching, data locality,<br/>async non-critical work] NFR3[RPO = 0] --> D3[Synchronous replication,<br/>consensus-based storage] NFR4[10x traffic spikes] --> D4[Autoscaling, queues,<br/>load shedding] NFR5[PCI DSS] --> D5[Tokenization, segmented<br/>cardholder data environment] NFR6[Low cost per user] --> D6[Serverless / scale-to-zero,<br/>tiered storage]
Trade-offs between quality attributes
| Improving | Usually costs |
|---|---|
| Consistency | Latency and availability during partitions |
| Availability (multi-region) | Cost, complexity, consistency |
| Security (more controls) | Usability, latency, delivery speed |
| Performance (caching) | Freshness, complexity of invalidation |
| Flexibility (configurability) | Performance, testability |
Technology options for capturing NFRs
- ISO/IEC 25010 quality model as a checklist of attribute categories.
- SEI Quality Attribute Workshop and ATAM (Architecture Tradeoff Analysis Method) for evaluating designs against scenarios.
- SLOs defined in tooling (Google Cloud SLO monitoring, Datadog SLOs, Nobl9, Sloth for Prometheus).
- The NFR checklist tool in this hub.
Architect-level considerations
[!ARCHITECT] Rank NFRs. When availability and consistency conflict for a given capability, the business must say which wins. Different parts of the same system can rank them differently: stock display vs stock reservation.
[!EA] Standardize NFR tiers (for example Tier 0 = payments, Tier 1 = customer-facing, Tier 2 = internal) so every system inherits a baseline for availability, DR and security.
[!CTO] Every extra "nine" of availability multiplies cost. Ask what an hour of downtime costs the business before funding active-active multi-region.
Interview questions and answers
What is the difference between an SLA and an SLO, and which do you design for?
Design for the SLO, which should be stricter than the SLA so you have a buffer before contractual penalties. The SLA is the external promise; the SLO is the engineering target; the error budget (100% minus the SLO) is the amount of unreliability you can spend on releases and experiments.
Name NFRs that are often forgotten.
Operability (on-call, runbooks), observability, data retention and deletion, accessibility, internationalization, cost limits, supportability, auditability, and migration/rollback requirements.
How would you test a latency NFR?
Load test with production-like data and traffic mix, measure percentiles (not averages) at the target throughput, include dependencies or realistic stubs, and run it in CI before major releases. Monitor the same SLI in production.