Skip to content

Non-Functional Requirements and How They Drive Design

Intermediate 44 min read Part 2 of 18

The quality goals (scale, latency, availability, consistency, durability, security, cost) that shape an architecture, and how to quantify them as SLOs.

Summary#

Non-functional requirements (NFRs), also called quality attributes, describe how well a system must work:

  • Scalability: how much load it handles and how it grows.
  • Availability: how often it answers.
  • Reliability: how often it answers correctly.
  • Latency: how fast it answers, measured as percentiles such as p50 and p99.
  • Throughput: how much work per second.
  • Consistency: how fresh the data is.
  • Durability: whether saved data can be lost.
  • Security and privacy.
  • Cost.
  • Maintainability and operability: how easy it is to change and run.

Functional requirements decide which features exist. NFRs decide the architecture, because they determine replication, caching, partitioning, regions and protocols.

Every important NFR must be quantified, ideally as a service level objective (SLO): a target for a measured indicator (SLI) over a time window. The gap to 100% is an error budget you can spend on change. Each NFR maps to concrete mechanisms, and NFRs conflict (consistency against latency, availability against cost, durability against write speed). So rank the top two or three per feature and say plainly what you trade away.

Why It Exists#

Two systems with identical features can need completely different architectures. A to-do app for one team and a to-do app for 100 million people both let you "add a task". The differences are all non-functional:

  • Scale: 20 users against 100 million.
  • Latency: "a second is fine" against "under 100 ms in Tokyo and São Paulo".
  • Availability: "office hours" against "always".
  • Durability: "we can re-type it" against "never lose a task".
  • Compliance: none against GDPR in 27 countries.

The first fits on a single small server. The second needs multi-region replication, caching, sharding, an on-call rota and a security programme.

If you skip NFRs, you get one of two failures. Either the system collapses under real load or loses data in the first incident, or you build a costly distributed system for a problem one server could handle. In Requirements Gathering you learned to capture NFRs with numbers. This page goes through each quality in depth: what it means precisely, how to measure it, what targets are realistic, which mechanisms deliver it, and how the qualities fight each other.

How It Works#

Each quality below has a definition, a way to measure it, typical targets and the mechanisms that deliver it. A useful reference model is ISO/IEC 25010, the international standard for software product quality. It groups qualities into characteristics such as:

  • performance efficiency;
  • reliability;
  • security;
  • maintainability;
  • compatibility;
  • portability;
  • usability;
  • functional suitability.

System design focuses on the first four, plus cost, consistency and durability, which distributed systems add to the list.

Scalability#

Scalability is the ability to handle growing load by adding resources, with performance staying acceptable and cost growing roughly in proportion. It is not a yes/no property. It is a statement about a specific load parameter:

  • requests per second;
  • concurrent connections;
  • data volume;
  • number of tenants;
  • fan-out per write, such as followers per user.

Martin Kleppmann's framing in Designing Data-Intensive Applications is useful: first describe load with the parameters that matter for your system, then ask what happens to performance when a parameter grows. For Twitter's home timeline, the critical parameter was not tweets per second but the fan-out, meaning how many followers each tweet must reach.

Clifford Neuman's 1994 paper "Scale in Distributed Systems" distinguished three dimensions, which are still a good checklist:

  • Size (load) scalability: more users, requests and data.
  • Geographic scalability: users and servers spread far apart, so latency between them grows.
  • Administrative scalability: many organisations or teams operating or using the system, each with its own policies.

Modern systems add elasticity: scaling up and down automatically as load changes, so you pay only for what you use.

How to state it:

  • "Serve 10M DAU with 3x peak-to-average traffic, growing 2x per year."
  • "Ingest 200k events per second at peak with no more than 5 minutes of lag."
  • "Add a new region in under a week."

Mechanisms:

  • stateless services behind load balancers;
  • horizontal scaling and autoscaling;
  • caching;
  • read replicas;
  • sharding;
  • asynchronous processing through queues;
  • partitioned logs.

See Vertical vs Horizontal Scaling.

Availability#

Availability is the share of time, or the share of requests, for which the system answers successfully. It is usually stated in "nines":

AvailabilityDowntime per yearPer 30-day monthPer week
99% ("two nines")~3.65 days~7.2 hours~1.7 hours
99.9%~8.8 hours~43.8 minutes~10 minutes
99.95%~4.4 hours~21.9 minutes~5 minutes
99.99%~52.6 minutes~4.4 minutes~1 minute
99.999%~5.3 minutes~26 seconds~6 seconds

There are two ways to measure it, and the choice matters:

  • Time-based: uptime divided by total time. Simple, but it treats a 5-minute total outage at 3 a.m. the same as one at peak.
  • Request-based: successful requests divided by total requests. This reflects user experience better, and it is what most SLOs use. It must count requests that never arrived, for example when the load balancer is down, so measure at the edge or with synthetic probes.

A classic formula connects availability to failure and repair rates: A = MTBF / (MTBF + MTTR), where MTBF is the mean time between failures and MTTR is the mean time to repair. It shows that fast recovery is as valuable as rare failure. Halving MTTR improves availability as much as doubling MTBF, and it is often far cheaper: better alerts, faster rollbacks, automated failover.

Availability composes:

  • Components in series (all must work) multiply: three services at 99.9% each give at most about 99.7%.
  • Redundant components in parallel (any one is enough) combine as 1 − (1 − a)^n: two independent replicas at 99% give 99.99%, if their failures are independent. Correlated failures, such as the same bug, the same zone or the same bad config push, break that assumption. This is why deploys are staged and replicas are spread across zones.

In this chain:

  • The two app replicas in parallel give 1 − 0.005² ≈ 99.9975%.
  • In series with the load balancer, database and payment provider, the result is about 0.9999 × 0.999975 × 0.9995 × 0.999 ≈ 99.84%.

The weakest serial dependency dominates. To promise 99.9% to users, you would need a fallback for payments, such as queueing orders when the provider is down. See Availability and Reliability.

Mechanisms:

  • redundancy in every tier;
  • multiple availability zones and regions;
  • health checks with automated failover;
  • graceful degradation;
  • timeouts, retries and circuit breakers;
  • staged deploys;
  • removing single points of failure.

Reliability#

Reliability means the system keeps doing the right thing, even when parts fail, not just doing a thing. A system that is up but returns wrong balances, duplicates orders or silently drops messages is available but unreliable. Users often tolerate a short outage better than wrong data.

Some precise vocabulary helps:

  • A fault is one component deviating from its spec: a disk error, a crashed process, a slow network link.
  • A failure is the system as a whole failing to provide its service to users.
  • Fault tolerance is designing so that faults do not become failures.

Distributed systems also classify faults by type:

  • Crash faults: a node stops.
  • Omission faults: messages are lost.
  • Timing faults: responses arrive too slowly.
  • Byzantine faults: a node behaves arbitrarily, through bugs, corruption or malice.

Most business systems design for crash, omission and timing faults. Byzantine tolerance is used in blockchains and some safety-critical systems. See Distributed Systems Fundamentals.

How to state it:

  • "Zero lost or duplicated payments."
  • "Every order event is processed at least once and applied exactly once."
  • "Ledger totals reconcile daily with zero unexplained differences."

Mechanisms:

  • database transactions and constraints;
  • idempotency keys on every retried operation;
  • input validation;
  • checksums;
  • reconciliation jobs that compare systems and flag mismatches;
  • outbox patterns for reliable event publishing;
  • chaos and fault-injection testing.

See Idempotency and Delivery Semantics.

Latency (p50 and p99)#

Latency is how long one operation takes, from the user's or caller's point of view. Always describe it with percentiles, never just the average:

  • p50 (the median): half of requests are faster. This is the typical experience.
  • p95 / p99: 95% or 99% of requests are faster. The slowest 1% are the tail.
  • p99.9 and max: matter for very high-volume or fan-out systems.

Averages hide the tail. A service with p50 = 40 ms and p99 = 2,000 ms has an average of perhaps 70 ms, which looks fine, while one request in a hundred is painfully slow. And the tail hits your most valuable users most often:

  • Heavy users make the most requests, so they meet the slow 1% most often.
  • Pages that fan out to many backend calls take the slowest of those calls.

Jeffrey Dean and Luiz André Barroso's article "The Tail at Scale" (Communications of the ACM, 2013) showed the maths. Suppose a request fans out to 100 servers in parallel, and each is slow (above its p99) 1% of the time. Then 1 − 0.99^100 ≈ 63% of requests will wait for at least one slow server. Large systems therefore target the p99 or p99.9 of each component, and use techniques such as hedged requests: send a backup request if the first has not answered by the p95 time, and take whichever answers first.

Two measurement traps are worth knowing:

  • You cannot average percentiles. The p99 of a whole fleet is not the average of each server's p99. Collect histograms (Prometheus histograms, HdrHistogram, t-digest sketches) and compute percentiles from the merged data.
  • Coordinated omission (a term from Gil Tene, the author of HdrHistogram). Many load generators wait for a response before sending the next request, so when the server stalls they stop sending, and the stall barely appears in the results. Measure latency from each request's intended send time, or use tools that correct for this, such as wrk2.

How to state it:

  • "Feed API: p50 < 80 ms, p99 < 300 ms, measured at the load balancer, at 50k requests/s."
  • "Search-as-you-type: p99 < 100 ms end to end."

Rough guides from user-experience research:

  • About 100 ms feels instant.
  • About 1 s keeps a user's flow of thought.
  • About 10 s loses attention.

These come from Robert Miller's 1968 work and were popularised by Jakob Nielsen.

Mechanisms:

  • caching and CDNs;
  • precomputation, such as materialised views and precomputed feeds;
  • fewer network round trips;
  • data placed close to users;
  • async processing for non-critical work;
  • connection reuse;
  • efficient serialisation;
  • timeouts and hedging for tails.

See Latency, Throughput and Performance.

Throughput#

Throughput is how much work the system completes per unit of time: requests per second (RPS or QPS), messages per second, rows per second, or MB/s. Latency and throughput are related but different:

  • A highway's latency is how long one car takes to cross it.
  • Its throughput is how many cars cross per hour.

You can raise throughput without changing latency by adding lanes (parallelism). Batching often raises throughput but increases latency, because each item waits for its batch.

Little's law links them: L = λ × W. The average number of items in the system (L) equals the arrival rate (λ) multiplied by the average time each spends inside (W). For example:

  • A service handles 2,000 requests/s at 50 ms each, so about 100 requests are in flight at any moment.
  • It therefore needs about 100 concurrent workers or connections.
  • If latency rises to 500 ms (a slow database), the same load needs 1,000. Thread pools and connection pools then run out, and the system falls over.

That is why latency problems often turn into throughput and availability problems.

Throughput also has a knee. As utilisation approaches 100%, queueing delay grows sharply. A simple queueing model (M/M/1) gives a waiting time proportional to ρ / (1 − ρ), where ρ is utilisation, which explodes as ρ approaches 1. In practice, plan to run CPU-bound tiers at 50-70% utilisation at peak so there is headroom for spikes and failover.

How to state it:

  • "Sustain 50k writes/s at peak with p99 < 50 ms."
  • "Process 1 TB of logs per hour."
  • "Each worker handles 200 jobs/s."

Mechanisms:

  • horizontal scaling;
  • partitioning, so work proceeds in parallel;
  • batching and pipelining;
  • append-only logs (Kafka);
  • write-optimised storage engines (LSM trees);
  • asynchronous I/O;
  • back pressure and load shedding to protect capacity.

Consistency#

Consistency in the NFR sense describes how fresh and how coherent the data is that readers see. It is a spectrum:

  • Strong (linearizable): every read sees the latest committed write, as if there were one copy. This is required for bank balances, seat bookings, unique usernames and leader election.
  • Sequential, causal: readers see writes in an order that respects cause and effect. A reply never appears before the message it answers.
  • Session guarantees: read-your-writes (you see your own updates), monotonic reads (you never see time go backwards).
  • Eventual: if writes stop, all replicas converge. Readers may see stale data for a while: milliseconds normally, seconds or minutes under failure.

Consistency is expensive in distributed systems, because a strong guarantee across replicas needs coordination, and coordination costs round trips. Two theorems formalise this:

  • CAP: during a network partition you must choose between consistency and availability.
  • PACELC: even without partitions, there is a trade-off between latency and consistency.

See CAP Theorem and PACELC and Consistency Models.

How to state it per data type, not for the whole system:

  • "Account balance: strongly consistent."
  • "Follower count: may lag by up to 60 s."
  • "User's own profile edits: read-your-writes."
  • "Search index: new items searchable within 5 s."

Mechanisms:

  • single-leader databases with synchronous replication for strong data;
  • consensus (Raft, Paxos) for coordination;
  • transactions;
  • sticky reads or primary reads after a user's own writes;
  • asynchronous replication, caches and CDC pipelines for data that can lag;
  • conflict resolution (last-writer-wins, CRDTs) for multi-writer data.

Durability#

Durability means that once the system says "saved", the data survives:

  • disk failures;
  • machine crashes;
  • data center loss;
  • operator mistakes.

Durability is separate from availability. Data can be safe but temporarily unreachable (durable, unavailable). Or a service can answer quickly from memory but lose writes on a crash (available, not durable). Amazon S3 publishes a durability design target of 99.999999999% (eleven nines) per object per year, with a much lower availability target, which makes the distinction concrete.

Durability is easiest to reason about through probabilities and failure domains:

  • Suppose a disk has an annual failure rate of about 1-2%. One copy on one disk loses data about once in 50-100 disk-years.
  • With three copies on different machines, and a lost copy re-replicated within an hour, losing all three needs two more failures during that window. That is far less likely, if the failures are independent.
  • The real risks are therefore correlated:
    • the same rack or power feed;
    • the same zone flooding;
    • the same software bug corrupting every replica;
    • an engineer running a bad delete.
  • Replicas spread across zones protect against the first two.
  • Backups, point-in-time recovery, versioning and delayed replicas protect against the last two. Replication alone faithfully copies the bug.

How to state it:

  • RPO (recovery point objective): how much recent data you may lose in a disaster. "RPO = 0 for payments; 5 minutes for analytics."
  • RTO (recovery time objective): how quickly you must be back. "RTO = 15 minutes."
  • "Acknowledged uploads survive the loss of any single zone."

Mechanisms:

  • write-ahead logs with fsync;
  • synchronous replication before acknowledging, such as quorum writes or semi-sync replicas;
  • cross-zone and cross-region replication;
  • object storage for blobs;
  • backups tested by regular restores;
  • object versioning and soft delete;
  • checksums to detect silent corruption.

Security and privacy#

Security is about protecting the system and its data against misuse. The classic CIA triad is:

  • Confidentiality: only authorised parties can read data.
  • Integrity: data is not modified without authorisation.
  • Availability: attackers cannot deny service.

Two more are often added:

  • Authenticity: you know who you are talking to.
  • Non-repudiation: actions are traceable to their actor.

Privacy is about the rights of the people the data describes: collecting only what is needed, using it only for stated purposes, letting users access and delete it, and keeping it in permitted locations.

How to state it:

  • "All traffic uses TLS 1.2+."
  • "Personal data is encrypted at rest with keys in a KMS."
  • "Every admin action is audit-logged and kept for 1 year."
  • "User data deletion completes within 30 days across all stores."
  • "EU users' data stays in EU regions."
  • "Comply with PCI DSS for card data by never storing raw card numbers."

A structured way to find security requirements is threat modelling. STRIDE, developed at Microsoft, walks each component through six threats:

  • Spoofing;
  • Tampering;
  • Repudiation;
  • Information disclosure;
  • Denial of service;
  • Elevation of privilege.

Mechanisms:

  • authentication (OAuth 2.0, OpenID Connect) and authorisation (RBAC, ABAC);
  • least-privilege service identities;
  • encryption in transit and at rest;
  • secrets management;
  • network segmentation;
  • rate limiting and DDoS protection;
  • tokenisation of sensitive fields;
  • audit logs;
  • data classification and retention policies.

See Authentication and Authorization.

Cost#

Cost includes:

  • cloud bills: compute, storage, network egress, managed services;
  • licences;
  • engineering and operations time, often the largest item.

A design that meets every other target but costs ten times the budget is a failed design.

Express cost as unit economics: cost per user per month, per 1,000 requests, per GB stored, or per transaction. Then compare it with revenue per unit. "Infrastructure cost below $0.02 per monthly active user" is a requirement you can design against. The FinOps practice applies this continuously: tagging resources by team and feature, reviewing spend, and treating cost as an engineering metric.

Typical big cost drivers in system design:

  • Network egress: data leaving a cloud region or going to the internet is often charged per GB, and cross-region replication of large datasets adds up quickly.
  • Over-provisioning for peak: autoscaling, spot or preemptible capacity, and queues that flatten peaks reduce it.
  • Hot storage for cold data: tiering to cheaper object storage classes and archives can cut storage cost several-fold.
  • High-availability multiples: every extra replica, zone or region multiplies cost. Make sure each "nine" is worth it.
  • Operational toil: a self-hosted cluster that needs one engineer full-time can cost more than a managed service.

Mechanisms:

  • managed and serverless services where they are cheaper in total;
  • autoscaling;
  • caching, which reduces expensive database capacity;
  • storage tiering and retention limits;
  • compression;
  • choosing regions;
  • reserved capacity for steady baselines.

Maintainability and operability#

Maintainability is how easily engineers can understand, change, test and extend the system. Operability is how easily it can be deployed, monitored, debugged and recovered, including at 3 a.m. by someone who did not write it. Kleppmann splits maintainability into three parts:

  • operability: easy for operations teams to keep running;
  • simplicity: easy for new engineers to understand;
  • evolvability: easy to change for new requirements.

These qualities are hard to quantify directly, but you can measure their effects. The DORA metrics, from the research behind Forsgren, Humble and Kim's Accelerate (2018), are widely used:

DORA metricWhat it measuresHigh-performer example
Deployment frequencyHow often you ship to productionOn demand, several times a day
Lead time for changesCommit to running in productionUnder a day
Change failure rateShare of deploys causing incidents or rollbacksLow, for example under 15%
Time to restore serviceHow long recovery takes after an incidentUnder an hour

The Accelerate research found that teams strong on speed tended also to be strong on stability, rather than trading one for the other. Practices such as automation, small batches and good monitoring drive both.

How to state it:

  • "Any engineer can deploy a change to production in under 30 minutes, with automated rollback."
  • "Mean time to recovery under 30 minutes."
  • "Each service has dashboards for its SLIs and a runbook for its top alerts."
  • "A new engineer ships a change in their first week."

Mechanisms:

  • simple architectures, with fewer moving parts than you think you need;
  • clear module and service boundaries;
  • CI/CD pipelines;
  • feature flags and canary releases;
  • infrastructure as code;
  • structured logs, metrics and traces;
  • runbooks;
  • consistent conventions across services.

See Observability.

Quantifying NFRs as SLOs#

Vague NFRs cannot guide design or operations. Google's SRE practice gave the industry a three-layer vocabulary, now used almost everywhere:

  • An SLI (service level indicator) is a measurement, usually a ratio of good events to total events: "the proportion of feed requests answered successfully in under 300 ms".
  • An SLO (service level objective) is an internal target for the SLI over a window: "99% of feed requests under 300 ms, measured over 30 days".
  • An SLA (service level agreement) is a contract with customers, with penalties such as service credits if it is missed. SLAs are deliberately looser than SLOs, so that you breach your internal target, and react, before you breach the contract.

The gap between 100% and the SLO is the error budget:

  • With a 99.9% availability SLO over 30 days, you may "spend" about 43 minutes of full outage, or the equivalent in partial errors, on deploys, experiments and incidents.
  • While budget remains, teams ship quickly.
  • When it is spent, they slow down risky changes and invest in reliability.

This turns the argument "is it reliable enough?" into a number that product and engineering share. It also makes clear that 100% is the wrong target. Each extra nine costs far more than the last, and users cannot tell the difference beyond what their own network and devices allow.

Choosing good SLIs:

  • Measure what users experience, at the edge (load balancer, client telemetry), not CPU or memory.
  • Use request-based ratios: good events divided by valid events.
  • Pick one SLI per critical user journey ("load feed", "upload photo", "checkout"), not one per microservice.
  • Use common SLI types: availability, latency, freshness (for pipelines: data newer than X), correctness, and coverage (the share of records processed).

Alerting on SLOs. Alert on the burn rate, meaning how fast the error budget is being consumed, rather than on single error spikes.

  • A burn rate of 1 uses exactly the whole budget over the window.
  • A burn rate of 14.4 sustained for 1 hour consumes 2% of a 30-day budget. That is a reasonable threshold to page someone.
  • Slower burns create tickets instead of pages.

Google's SRE Workbook recommends multi-window, multi-burn-rate alerts, which combine a long window (to be significant) with a short window (to reset quickly once the problem is fixed).

Mapping each NFR to design choices#

This is the core skill: every NFR should point to a concrete mechanism you can draw on the diagram.

NFRTarget exampleDesign choices it pushes
Scalability50k writes/s, 2x growth per yearStateless services, horizontal scaling, sharding, partitioned queues
Availability99.99% for readsRedundancy in every tier, multi-AZ, failover, health checks, degradation modes
ReliabilityZero lost or duplicated paymentsTransactions, idempotency keys, outbox, reconciliation jobs
Latencyp99 < 200 msCaching, CDN, precomputation, fewer hops, hedged requests
Throughput1 GB/s ingestBatching, append-only logs (Kafka), partitioned consumers, LSM storage
ConsistencyNo double bookingSingle-leader DB, transactions, row locks, consensus
DurabilityRPO = 0 for uploadsSync replication across zones, object storage, WAL, tested backups
SecurityPII protected, audit trailEncryption, least privilege, audit logs, tokenisation, KMS
PrivacyDelete user data within 30 daysData inventory, deletion pipeline, per-region stores
Cost< $0.02 per MAU per monthManaged services, autoscaling, storage tiering, caching
OperabilityMTTR < 30 min, daily deploysCI/CD, feature flags, canaries, metrics, traces, runbooks

Two habits make this mapping stronger:

  • NFRs are per feature, not per system. Checkout needs strong consistency and high durability. Browsing needs low latency and can be stale. Analytics needs throughput and tolerates hours of delay. A single system-wide target forces over-engineering everywhere or under-engineering where it matters.
  • Every mechanism should trace back to an NFR. If you cannot say which requirement a component serves, it is probably unnecessary.

Conflicting NFRs and prioritisation#

NFRs fight each other. You cannot maximise everything, and the skill is in choosing deliberately.

Pair in tensionWhy they conflictTypical resolution
Consistency vs latencyStrong consistency across replicas needs round trips (80-100 ms US-EU)Strong only where needed; local reads with bounded staleness elsewhere
Consistency vs availabilityDuring a partition, a replica must refuse writes or risk divergence (CAP)Choose per data type: CP for money, AP for carts and likes
Availability vs costEvery nine needs more replicas, zones, regions and on-callSet the SLO to what users value; not everything needs 99.99%
Durability vs write latencyWaiting for several replicas or fsync slows each writeSync for critical data; async with small RPO for the rest
Security vs usabilityMFA, short sessions and strict checks add frictionRisk-based authentication; step-up only for sensitive actions
Performance vs maintainabilityHand-tuned, denormalised, cached code is harder to changeOptimise only measured hotspots; keep the rest simple
Throughput vs latencyBatching raises throughput but delays individual itemsSmall batches with time limits (for example 5 ms or 100 items)
Cost vs latencyEdge caches and more regions reduce latency but cost morePlace capacity where users and revenue are

To prioritise:

  1. Rank NFRs per critical user journey, with the business. "For checkout: correctness > durability > availability > latency. For browsing: latency > availability > freshness."
  2. Build a utility tree, as in the SEI's ATAM method. Break each quality into concrete scenarios and rate each by business importance and technical difficulty (High/Medium/Low). High-High scenarios get design attention first.
  3. State the trade-off explicitly, in the design doc or out loud in an interview: "We accept up to 5 s of staleness in follower counts to keep reads local and under 50 ms."

The two letters in each leaf are business importance and technical difficulty. The leaves marked (H, M) or (H, H) get attention first.

Finding the right NFRs: a checklist#

In a design review or an interview, the hard part is not knowing what "availability" means. It is deciding which qualities matter for this system. A good habit is to phrase each one as a sentence about the system ("the system should be able to..." or "the system should be...") and then attach a number and a scope.

Walk through this checklist and keep the three to five items that will actually shape the design:

  • Consistency vs availability. When the network partitions, which matters more for each kind of data? Partition tolerance itself is not optional in a distributed system, so the real choice is what to give up during a partition.
  • Environment constraints. Where does the code run? Phones with limited battery, memory and flaky networks; smart TVs; embedded devices; users on slow mobile connections watching video. These constraints change protocols, payload sizes and how much work happens on the client.
  • Scalability. Is traffic steady or bursty? Are there daily peaks, holiday spikes or single events, such as one concert on sale to 10 million people? Is the system read-heavy or write-heavy, and by how much?
  • Latency. Which requests must be fast? Focus on the ones that need real computation, such as search, matching and ranking, not on trivial lookups.
  • Durability. How bad is losing data? A social network may tolerate losing a "like"; a bank cannot lose a transfer.
  • Security. What data is sensitive, who may access what, and what must be audited?
  • Fault tolerance. Which component failures must be invisible to users, and how fast must the system recover from the rest?
  • Compliance. Which laws, regulations and standards apply: data protection, payments, health, data location?

Put every NFR in context. "The system should be low latency" says nothing; every system should be fast. "Search should return within 500 ms at p99" tells the reader which part of the system needs the effort and what target to hit. The same goes for availability ("the redirect path at 99.99%"), consistency ("no double booking of a seat") and scale ("10 million users trying to buy tickets to one event").

Say what is out of scope. Listing a few items "below the line", such as spam detection, fraud scoring or full GDPR tooling, shows you thought about them and lets the interviewer redirect you if they care. Do not spend long on it; it is a nice-to-have, and time spent inventing extra features earns little.

Do capacity estimation only when it changes a decision. Computing storage, QPS and bandwidth just to conclude "it's a lot" adds nothing. Estimate when the answer picks between designs:

  • Does the set of trending topics fit in one in-memory heap, or must it be sharded?
  • Can one server hold all concurrent WebSocket connections for a region, or do we need hundreds of gateways?
  • Does five years of data fit on one database node?

Otherwise say you will do the maths during the design, where it is needed. See Back-of-the-Envelope Estimation and Requirements Gathering.

Worked examples: NFRs for classic design problems#

The best way to learn NFRs is to see how different products produce different lists, and how each line changes the architecture.

SystemKey NFRs (quantified)What each one forces in the design
URL shortenerEach short code maps to exactly one long URL; redirect in under 100 ms; 99.99% availability, favouring availability over consistency; 1 billion URLs and 100M DAU; about 1,000 reads per writeA uniqueness guarantee (counter-based codes or a unique constraint); aggressive caching and CDN for redirects; replicas; the read:write ratio makes it a caching problem first
Ticket bookingAvailability for browsing and search, consistency for booking (no double booking); 10M users for one popular event; search under 500 ms; about 100 reads per writeStrongly consistent booking with holds and transactions; a virtual waiting queue for hot events; a search engine and caches for reads
Live commentsMillions of concurrent videos and thousands of comments per second on a popular one; eventual consistency is fine; broadcast in under 200 ms end to endPush delivery (WebSockets or server-sent events); pub/sub partitioned by video; no cross-region consensus on the hot path
Chat (WhatsApp-style)Delivery to online users in under 500 ms; guaranteed delivery; billions of users; messages kept on servers no longer than necessary; resilient to component failurePersistent connections; acknowledged delivery with retry; a per-recipient inbox deleted after acknowledgement; replicated stores
Ad click aggregatorPeak of 10,000 clicks per second over 10M active ads; sub-second advertiser queries; no click lost; each click counted once; data queryable as soon as possibleA durable log as the ingest buffer; idempotent processing keyed by click ID; stream aggregation into an OLAP store; a batch reconciliation path
Payment systemAbout 10,000 transactions per second at peak; never lose or duplicate a payment; strong security and complianceIdempotency keys; a ledger with transactions; synchronous replication; tokenised card data to shrink compliance scope; reconciliation
News aggregatorAvailability over consistency: slightly old headlines beat an error page; fast feed loadsCaching and CDN; precomputed feeds; asynchronous ingestion
Online auctionAsk about scale first: bids per second on a hot item and in total decide the design; the current highest bid must be correctSerialised bid acceptance per item (a single-writer partition or conditional writes); fan-out of price updates to watchers

Three patterns appear again and again:

  1. Different journeys get different answers to the same question. Ticket booking wants availability for browsing and consistency for buying. Writing one system-wide "CP" or "AP" label would be wrong for half the system.
  2. The read:write ratio is often the most design-relevant number. At 1,000:1 a URL shortener is a caching and replication problem; the write path barely matters. A click aggregator is the opposite: almost all traffic is writes, so the design is about ingest and aggregation.
  3. "Never lose" and "never double count" come as a pair. Retrying to avoid loss creates duplicates, so durability on the write path almost always implies idempotency downstream.

The URL shortener in detail. "Each short code maps to exactly one long URL" is unusual: a correctness NFR phrased as a uniqueness constraint. It rules out naive random codes without a collision check, and pushes towards either a database unique constraint (insert and retry on conflict) or a global counter encoded in base 62, often handed out in blocks to each server so they do not coordinate on every write. "Redirect in under 100 ms" with 1,000 reads per write means the redirect path should almost never touch the database: an in-process or Redis cache, and possibly CDN caching of redirect responses. "99.99%, availability over consistency" means a stale cache entry for a few seconds is fine, which allows replicas and caches everywhere on the read path.

The ad click aggregator in detail. Its NFRs pull against each other, and the design exists to satisfy all of them at once:

  • "No click lost" means the click is written to a durable, replicated log (Kafka or Kinesis) before the user is redirected, and nothing downstream acknowledges until data is safely stored.
  • "Each click counted once" means every click carries a unique ID, generated or signed server-side so clients cannot forge it. The aggregation step deduplicates on it.
  • "As real-time as possible" should be quantified with the interviewer, for example "advertisers see clicks within 1 minute". It points to stream processing (Flink, or Spark Structured Streaming) writing minute-level aggregates into an OLAP store.
  • "Sub-second advertiser queries" means queries read pre-aggregated rows, never raw events.
  • A periodic batch job over the raw log recomputes the same aggregates and corrects any drift from the stream. That is the reliability safety net for the "no loss, no duplicates" requirements.

The chat system in detail. "Guaranteed delivery" and "stored no longer than necessary" combine into a specific design. A message is written to the recipient's inbox in a durable store and pushed over the recipient's open connection if they are online. The recipient's device acknowledges it, and only then is the server copy deleted. Offline recipients receive the backlog when they reconnect. The privacy NFR thus becomes a data-lifecycle rule, and the durability NFR becomes an acknowledgement protocol.

From traffic shape to design: peaks, ratios and bursts#

Average load hardly ever breaks a system; peaks do. Turning traffic into NFRs means stating three numbers: the peak, the ratio between reads and writes, and how bursty the load is.

Peak versus average. A common heuristic is that peak traffic is about 10 times the daily average for consumer products, though steady B2B systems may see only 2-3 times. Work it in both directions:

  • From a peak: 10,000 clicks per second at peak, with peak about 10 times the average, gives an average of about 1,000 per second, or 1,000 × 86,400 ≈ 100 million clicks per day.
  • From a daily total: 100M DAU each making 20 requests a day is 2 billion requests a day, an average of about 23,000 per second. With a peak factor of 3-10, design for 70,000-230,000 requests per second on the busiest tier.

Capacity is sized for the peak plus headroom; cost is dominated by the average. That gap is why autoscaling and queues, which absorb peaks without paying for peak capacity all day, matter so much.

Read:write ratio. It decides where the engineering goes:

RatioExampleDesign emphasis
1,000:1 or moreURL redirects, product pagesCaches, CDN, read replicas; writes can be simple
About 100:1Event browsing vs booking, social feedsCaching and denormalised reads; careful but modest write path
About 1:1Chat messages (each written once, read about once)Balanced; per-conversation partitioning
Write-heavyClicks, metrics, IoT telemetry, location updatesLog-based ingest, batching, LSM storage, pre-aggregation

Burstiness. Some systems see load arrive in a few seconds rather than over hours: a ticket on-sale, a flash sale, a push notification to 50 million users, the end of a big match. Bursts need their own NFR, because autoscaling usually reacts in minutes:

  • "Absorb 20 times normal traffic for 10 minutes at an announced on-sale" suggests a virtual waiting room, pre-scaling and admission control.
  • "A push to every user must not overload the API" suggests spreading the send over several minutes and adding jitter to client refreshes.

Environment constraints#

Systems are not only servers. When part of the system runs on user devices or poor networks, the constraints become NFRs of their own.

ConstraintExample requirementDesign consequences
Battery"Background sync uses under 2% battery per day"Batch network calls, use the platform push service instead of polling, avoid keeping the radio awake
Bandwidth and data cost"The feed loads usefully on a 3G connection"Smaller payloads, compressed images in modern formats, pagination, delta sync instead of full refreshes
Variable network"Video playback without stalls on fluctuating mobile links"Adaptive bitrate streaming (HLS, DASH) with several renditions per video, buffering ahead
Offline use"Notes can be edited offline and merged later"Local-first storage, operation logs or CRDTs, conflict resolution on sync
Device memory and CPU"Runs on low-end Android devices"Lighter client logic, server-side rendering or ranking
Old clients in the field"Clients up to 12 months old must keep working"Versioned, backward-compatible APIs, feature flags, server-driven behaviour

The last row is often forgotten. Server code can be redeployed in minutes, but mobile apps stay installed for months or years, so API compatibility becomes a long-term maintainability NFR.

Compliance and data residency#

Compliance requirements are NFRs that come from law, regulation or contracts. They are non-negotiable and often expensive to add later, so they belong in the first design discussion.

RegimeApplies toRequirements that change the architecture
GDPR (EU) and similar lawsPersonal data of people in the EULawful basis and purpose limits; access and deletion on request; breach notification to the regulator within 72 hours where required; limits on transfers outside the EU
PCI DSSSystems that store, process or transmit card dataStrict controls on every system "in scope"; the main design move is to shrink the scope by tokenising cards with a payment provider so your servers never see raw card numbers
HIPAA (US)Health informationAccess controls, audit logs, encryption, agreements with every processor
SOC 2Service providers, as a customer expectationDocumented and evidenced controls: access reviews, change management, monitoring
Data residency rulesVarious countries and sectorsData for some users must stay in specific regions, so routing and storage are partitioned by geography

Three designs come up again and again:

  • Scope reduction. Keep regulated data in as few systems as possible. Card numbers go straight from the browser to the payment provider's hosted fields or SDK; your systems only store a token. Health records live in one service with strict access, and others hold only references.
  • Deletion everywhere, including backups. "Delete a user's data within 30 days" sounds simple until you count caches, search indexes, analytics copies, logs and backups. A common technique is crypto-shredding: encrypt each user's data with a per-user key and delete the key to make every copy, including backups, unreadable. It still needs a data inventory that lists every store holding personal data.
  • Regional partitioning. If EU users' data must stay in the EU, route EU users to EU regions and keep their primary data there. Global features such as search or analytics then need either per-region copies or aggregated, anonymised data.

See Security Fundamentals for the controls themselves.

NFRs for data pipelines: freshness, completeness and correctness#

Request-response services have availability and latency. Batch and streaming pipelines need different words, because nobody waits on a single request:

  • Freshness: how old is the newest data a consumer can see? "95% of the time, dashboards include events up to 2 minutes old."
  • Completeness: what share of input made it through? "99.99% of events received by the ingest tier appear in the daily totals."
  • Correctness: are the outputs right? "Daily billing totals match the reconciled ledger exactly."
  • Throughput and backlog: "Sustain 200,000 events per second; recover from a 1-hour backlog within 2 hours."
  • Late data: "Events arriving up to 24 hours late are still counted in the right day."

These choices change the design:

  • Tight freshness pushes towards streaming instead of hourly batches.
  • Strict correctness pushes towards idempotent sinks, exactly-once processing where the tools support it, and reconciliation against a source of truth.
  • Late data needs event-time windows with watermarks, and a way to correct already-published aggregates.
  • Backlog recovery means the pipeline must be able to run well above normal throughput, so it needs scalable workers and a replayable log.

Writing NFRs well: rewrites of common vague statements#

VaguePreciseWhy it is better
"The system must be fast""Search p99 under 500 ms and feed p99 under 300 ms, measured at the load balancer at peak load"Names the journey, the percentile, the place and the load
"Highly available""Redirects 99.99% monthly, request-based; link creation 99.9%"Different journeys, a window and a method
"Scalable""100M DAU, 3x peak factor, 2x growth per year; survive a 20x burst for 10 minutes at on-sales"Names the load parameter, growth and the burst
"Consistent""No seat sold twice; seat maps may lag by up to 5 s"Strong where it matters, bounded staleness elsewhere
"Never lose data""RPO 0 for acknowledged orders across a zone loss; RPO 15 minutes for logical errors via point-in-time recovery"Separates hardware loss from mistakes
"Secure""All PII encrypted at rest with KMS keys, all admin actions audit-logged for 1 year, card data never stored"Testable controls
"Cheap""Infrastructure under $0.02 per MAU per month at 10M MAU"A unit cost you can design and track against
"Real-time""Advertisers see clicks within 60 s; comments broadcast within 200 ms"Real-time means very different things to different products

A useful anchor for "real-time" in user interfaces: people generally perceive a response within about 100-200 ms as instantaneous. That is why live comments, typing indicators and interactive search aim for around 200 ms end to end, while "real-time analytics" usually means seconds to a minute.

NFRs change as a product grows#

The right NFRs for a three-person startup are wrong for a company with 50 million users, and the reverse is just as true. Over-engineering early burns the time you need to find product fit; under-engineering late burns user trust.

StageTypical targetsWhat dominates the design
Prototype or MVP99.5% is fine; latency "good enough"; daily backupsSpeed of change; one region, one database, managed services
Early growth (around 100k users)99.9% for core journeys; p99 targets on the main pages; RPO of minutesReplicas, caching, basic SLO dashboards, on-call
Scale (millions of users)99.95-99.99% per journey; tight p99; RPO 0 for money and ordersMulti-zone everywhere, sharding, queues, error-budget policy, cost per unit
Very large or regulatedPer-cell and per-region SLOs; compliance regimes; data residencyCells, multi-region, formal change management, audits

A practical rule is to state the NFRs for the next 12-18 months of growth and leave seams for the step after: stateless services that can scale out, IDs that can be sharded on later, and a data model that does not block partitioning. See Scaling from Zero to Millions of Users.

Verifying NFRs: from paper to proof#

An NFR that is never tested is a hope. Each kind of requirement has its own way of being proven before launch and watched after it.

NFRBefore launchIn production
Throughput and scalabilityLoad tests at the expected peak plus headroom; stress tests past the limit to find the breaking point; spike tests for burstsSaturation dashboards (CPU, connections, queue depth); capacity forecasts
LatencyLoad tests with an open-model generator, so slow responses do not hide queueing (avoid coordinated omission); production-sized dataPercentile SLIs per journey from histograms; tracing for slow requests
Availability and fault toleranceChaos experiments: kill instances, a zone, a dependency; inject latencyRequest-based SLOs, burn-rate alerts, game days
Durability and recoveryRestore drills: actually restore a backup and time it against the RTO; failover testsBackup success monitoring; periodic automated restore checks
EnduranceSoak tests for 12-72 hours to reveal memory leaks, file-handle leaks and slow compactionLong-window trends in memory and latency
SecurityThreat modelling, static and dynamic scanning, dependency scanning, penetration testsAudit logs, anomaly alerts, access reviews
CostCost model of the design at target loadCost per unit (per request, per user, per GB) on a dashboard with an owner
MaintainabilityArchitecture fitness functions: automated checks that a property still holds, such as "no service calls the billing database directly" or "build under 10 minutes"DORA metrics: deploy frequency, lead time, change failure rate, time to restore

The idea of fitness functions comes from Building Evolutionary Architectures (Ford, Parsons and Kua, 2017). They turn an architectural NFR into a test that runs in CI, so it is protected from slow erosion. A page-weight or latency budget that fails the build when exceeded is a simple example.

Two details make load tests trustworthy:

  1. Open versus closed model. A closed-model tool runs a fixed number of virtual users who each wait for a response before sending the next request. When the server slows down, the tool sends less, so measured latency looks better than reality. An open-model tool sends at a fixed arrival rate whatever the response times, which is how real independent users behave. wrk2 works this way, and k6 has arrival-rate executors. Use it when the target is "p99 under X at Y requests per second".
  2. Realistic data and mix. Tests against an empty database or a single hot key mislead. Use production-shaped data volumes, a realistic mix of endpoints and a realistic key distribution (often Zipf-like, with a few very hot keys), and include cache-cold starts.

When to Use It#

  • Every design discussion, right after functional requirements.
  • When choosing between technologies, because the NFRs are the scoring criteria.
  • When setting up monitoring and alerting: SLOs tell you what to alert on.
  • When a stakeholder says "it must be fast and always up": translate it into numbers.
  • In capacity planning and cost reviews: throughput and cost targets drive sizing.
  • During incident reviews: which SLO was breached, and how much error budget was consumed?
  • When deciding whether to ship or stabilise, using the error budget.

When NOT to Use It#

  • Do not set strict SLOs for internal tools or prototypes; 99% availability and "fast enough" are fine.
  • Do not quantify NFRs that will not change the design. Precision is for the two or three that matter.
  • Do not copy another company's targets ("Google has five nines, so we do too"). Targets should reflect your users and your budget.
  • Do not set SLOs tighter than your dependencies can support unless you add redundancy or fallbacks for them.
  • Do not let NFR analysis delay a reversible decision. For things that are cheap to change later, pick a sensible default and revisit.

How to Implement It#

  1. List candidate NFRs using the qualities above, per critical user journey.
  2. Quantify each one: users, QPS, p99 latency, availability, freshness, RPO, RTO, cost per unit.
  3. Rank them per journey and state the top two or three.
  4. Map each to mechanisms (see the table) and check that the design includes them.
  5. Check composition: multiply serial availabilities and add up latency budgets across hops, so the end-to-end targets are achievable.
  6. Define SLIs and SLOs for critical journeys, and alert on error-budget burn rate rather than single spikes.
  7. Load-test and run failure tests (zone loss, dependency outage) to prove the targets before launch.
  8. Review regularly: after incidents, at growth milestones, and when costs change.
# Example SLO definition (tool-agnostic)
service: feed-api
journey: load-home-feed
slis:
  availability: successful_requests / valid_requests    # measured at the load balancer
  latency: requests_under_300ms / valid_requests
objectives:
  - sli: availability
    target: 99.9%
    window: 30d
  - sli: latency
    target: 99%
    window: 30d
alerting:
  page:   { burn_rate: 14.4, long_window: 1h, short_window: 5m }   # ~2% of budget in 1h
  ticket: { burn_rate: 1,    long_window: 3d, short_window: 6h }

A latency budget splits an end-to-end target across hops, so each team knows its share:

Target: feed p99 < 300 ms (server side, at the load balancer)
  load balancer + TLS reuse       5 ms
  API gateway (auth, rate limit) 10 ms
  feed service logic             20 ms
  feed cache read (Redis)         5 ms   (p99; misses fall back below)
  post hydration (batch, cache)  30 ms
  ranking / filtering            40 ms
  serialization + network        20 ms
  headroom for tail and retries 170 ms
TechnologyFits when
Prometheus + Grafana (SLO dashboards), Sloth, PyrraSelf-hosted metrics and SLO tracking
Datadog, New Relic, Google Cloud Monitoring SLOsManaged SLO and error-budget tracking
OpenTelemetryVendor-neutral traces and metrics to measure latency SLIs
k6, Locust, Gatling, wrk2Load testing for scalability and latency targets
Chaos tools (Chaos Mesh, AWS Fault Injection Service, Gremlin)Proving availability under failure
Cloud cost tools (AWS Cost Explorer, OpenCost, Kubecost)Tracking cost per unit and per team

Trade-offs#

ChoiceGainCostPick when
Tight SLO (99.99%)Users rarely see failuresMulti-zone or multi-region, more on-call, slower changeRevenue-critical journeys
Looser SLO (99.5-99.9%)Faster change, lower costMore visible failuresInternal tools, non-critical features
Per-journey NFRsRight-sized engineeringMore SLOs to trackAlmost always
Single system-wide NFRsSimple to explainOver- or under-engineeringTiny systems only
Strong consistencySimple correctness for users and developersLatency, reduced availability under partitionMoney, inventory, identity
Eventual consistencyLow latency, high availabilityStale reads, conflict handlingFeeds, counters, caches, analytics
Request-based SLIsMatch user experienceNeed edge measurementUser-facing services
Time-based uptimeSimpleHides partial outages and timingSimple components, contracts
Estimate capacity upfrontEarly sanity checkTime spent on numbers that may not matterOnly when a number picks between designs
Availability for browse, consistency for buyEach journey gets the right guaranteeTwo data paths to build and reason aboutTicketing, inventory, marketplaces
Remove a dependency from the hot pathLarge availability gainCaching, local verification or queues to buildA dependency is less available than your target
Retries for transient faultsFailure rate roughly squared per retryExtra load, duplicates without idempotencyIdempotent calls with a retry budget
Strict compliance scope reduction (tokenisation)Far fewer systems to auditDependence on a providerCard, health or other regulated data
Streaming pipeline for freshnessData visible in secondsMore moving parts than batchFreshness targets under minutes
Unit-cost target as an NFRCost stays visible as you scaleNeeds cost attribution per serviceAny system with large bandwidth or storage

Common Pitfalls#

  • Using averages instead of percentiles for latency, which hides the slow tail.
  • Computing fleet percentiles by averaging per-server percentiles, instead of merging histograms.
  • Load tests that suffer from coordinated omission and report rosy tails.
  • Promising 99.999% availability on top of dependencies that offer only 99.9%.
  • Treating all features the same; checkout and browsing need different targets.
  • Confusing durability with availability, or replication with backups.
  • Forgetting cost and operability until the bill or the on-call rota hurts.
  • Setting SLOs but never using the error budget to make decisions.
  • Measuring SLIs on servers, missing failures that happen before requests reach them, such as DNS, the load balancer or the CDN.
  • Ignoring correlated failures (same zone, same deploy, same bug) when computing redundancy.
  • Listing ten NFRs instead of the three to five that change the design, which hides the ones that matter.
  • Writing "low latency" without saying which journey, which percentile and which number.
  • Doing a long capacity estimate whose result changes nothing in the design.
  • Sizing for average traffic and forgetting peaks, bursts at on-sales and push-notification spikes.
  • Promising "never lose a click" without idempotency, so retries produce double counts.
  • Forgetting environment constraints such as mobile battery, bandwidth and old app versions in the field.
  • Treating GDPR deletion as one database delete, missing caches, search indexes, logs and backups.
  • Load testing with a closed-model tool or an empty database, then trusting the tail latencies.
  • Budgeting latency per step but forgetting that fan-out leaves need a much stricter percentile.

Real-World Examples#

Google's Site Reliability Engineering book (2016) and The Site Reliability Workbook (2018) popularised SLIs, SLOs, error budgets and burn-rate alerting. Many companies now use the same vocabulary and alerting approach.

Amazon S3 publishes a design target of 99.999999999% durability and a much lower availability target, together with an SLA that offers service credits. This shows clearly that durability, availability and contractual commitments are three separate things.

Dean and Barroso's "The Tail at Scale" describes how Google's large fan-out services manage tail latency with hedged and tied requests. The hedged-request idea is now built into gRPC (as hedging policies) and offered by many client libraries.

Amazon has described in public talks and writing how it designed parts of its retail checkout to keep accepting orders when downstream systems are impaired, by queuing work. This is an availability-over-consistency choice for one journey, while payment authorisation itself stays correct.

Stripe's public API documentation describes idempotency keys: clients send a unique key with each payment request, and the server returns the stored result for repeated keys instead of charging twice. This is the standard way to satisfy "never lose a payment" and "never charge twice" together.

Card payment providers such as Stripe and Adyen offer hosted payment fields and client SDKs so that raw card numbers go straight to the provider. The merchant's servers only see a token, which greatly reduces their PCI DSS scope. Scope reduction is a compliance NFR turned into architecture.

In the Interview#

Presenting NFRs in an interview: a five-minute script#

The NFR step should take about five minutes. A good rhythm:

  1. Ask about scale first if the prompt does not say. "Roughly how many users, and how many of X per second at peak?" For an auction, payments or click tracking, the answer changes the design more than anything else.
  2. State three to five NFRs as sentences with numbers and scope. For a Twitter-style feed: "The system should favour availability over consistency for the feed, since seeing a post a few seconds late is fine. It should support 100M+ DAU. The home feed should render in under 200 ms at p99. Posts, once accepted, must never be lost."
  3. Split consistency by data type. "Likes and follower counts can be eventually consistent; account changes and payments must be strongly consistent."
  4. Name what is out of scope. "I'll leave spam detection, moderation and analytics below the line unless you'd like them."
  5. Defer the arithmetic. "I'll estimate storage and fan-out costs when we reach the feed generation deep dive, because that is where the numbers decide push versus pull."

Then come back to the NFRs at the end. Walk through the design and show which component satisfies each one: "the cache gives us the 200 ms reads, the replicated log gives us durability, the per-video channels give us sub-200 ms broadcast." Interviewers at senior and staff levels look for this traceability more than for any single component.

Deep Dive: Tail latency, composite SLOs and error budgetsShow

Tail latency amplifies with fan-out. If one page calls 50 backend services in parallel and each has a 1% chance of being slow, the chance that the page is slow is 1 − 0.99^50 ≈ 40%. That is why large systems target the p99.9 of leaf services and use:

  • hedged requests: send a second copy after the p95 delay;
  • tied requests: send both copies, and the one that starts first cancels the other;
  • micro-partitioning: many small partitions, so a slow machine's work can move quickly;
  • good-enough results: return search results from 98% of shards rather than wait for the last 2%.

SLOs compose. If a request passes through three services in series, each at 99.9% availability, the best you can expect end to end is about 99.7%. To promise 99.9% to users:

  • each dependency must be better than that;
  • or you need redundancy or fallbacks;
  • or you must make the dependency non-critical: cache it, queue the work, or degrade gracefully.

A useful rule from Google's SRE writing is that a service's availability is bounded by its critical dependencies. Either pick dependencies that are an order of magnitude more available than your target, or design around them.

Error budgets change behaviour. With a 99.9% monthly SLO you have about 43 minutes of budget. Alerting on burn rate (how fast you are using it) is better than alerting on single errors:

  • A burn rate of 1 uses the budget in exactly 30 days.
  • A burn rate of 14.4 uses 2% of it in an hour.
  • A burn rate of 6 sustained for 6 hours uses 5%.

Pairing a long window with a short one, such as 1 hour and 5 minutes, makes alerts both significant and quick to clear once fixed.

RPO and RTO quantify disaster recovery:

  • RPO (recovery point objective) is how much data you can lose, such as "5 minutes of writes". It decides synchronous or asynchronous replication and backup frequency.
  • RTO (recovery time objective) is how fast you must be back, such as "1 hour". It decides between a cold standby (restore from backups, hours), a warm standby (scaled-down copy, minutes to an hour), and an active-active setup (seconds to minutes).
Deep Dive: Durability arithmetic and why replication is not backupShow

A simple model shows why three replicas and fast repair give very high durability, and also where the model breaks.

Suppose:

  • each disk fails independently with an annual failure rate (AFR) of 2%;
  • a failed replica is rebuilt in 1 hour, about 1/8,760 of a year.

With three replicas, data is lost only if the other two disks also fail during that hour:

  • The chance that one particular disk fails in a given hour is about 0.02 / 8,760 ≈ 2.3 × 10⁻⁶.
  • Both remaining disks failing in that window is about (2.3 × 10⁻⁶)² ≈ 5 × 10⁻¹².
  • Multiply by the roughly 0.06 first failures per year (3 disks × 2%).

The result is a loss probability per object per year on the order of 10⁻¹³, far beyond eleven nines. Real systems publish more modest numbers because the independence assumption is wrong in practice:

  • Correlated hardware failures: the same batch of disks, the same rack, the same power distribution, the same cooling event.
  • Slow detection and repair: a rebuild during peak load can take many hours, widening the window.
  • Latent sector errors: a "healthy" replica may already have unreadable blocks that you only discover during a rebuild. Periodic scrubbing (reading and checksumming everything) finds them early.
  • Software and human error: a bug that writes corrupt data, or a script that deletes the wrong prefix, is replicated faithfully to every copy within milliseconds.

The last point is why replication is not backup:

  • Replication protects against hardware loss.
  • Backups protect against logical loss. These include point-in-time snapshots, object versioning, delayed replicas, and immutable or write-once copies in a separate account.

A durability requirement should therefore name both, for example: "RPO = 0 for hardware or zone loss (synchronous cross-zone replication); RPO ≤ 15 minutes for logical errors (PITR); backups restorable within 4 hours, tested monthly."

Erasure coding gets high durability at lower storage overhead than full replicas. For example, Reed-Solomon with 10 data and 4 parity fragments survives any 4 lost fragments at 1.4x overhead, against 3x for triple replication. Large object stores and distributed file systems use it for cold and warm data, at the cost of more CPU and network work on reads and rebuilds. See Storage Fundamentals.

Deep Dive: Quality-attribute scenarios (the six-part form)Show

The Software Engineering Institute's architecture methods, including ATAM (Kazman, Klein and Clements, 2000) and the book Software Architecture in Practice by Bass, Clements and Kazman, use a precise format for NFRs called a quality-attribute scenario. It removes ambiguity by forcing six parts:

PartQuestionExample (availability)Example (performance)Example (modifiability)
SourceWho or what causes it?The cloud provider50,000 concurrent shoppersA product team
StimulusWhat happens?One availability zone becomes unreachableThey submit searches at 5,000 per secondAdd a new payment method
EnvironmentUnder what conditions?Normal peak trafficBlack Friday peak, warm cachesDuring normal development
ArtifactWhich part of the system?Checkout service and its databaseSearch APIPayment service
ResponseWhat should the system do?Fail over and keep accepting ordersReturn ranked resultsChange is made, tested and deployed
Response measureHow do we judge it?Under 60 s of elevated errors, zero lost acknowledged ordersp99 under 500 ms, error rate under 0.1%Within 2 weeks, touching only the payment service

Writing scenarios this way has three benefits:

  1. Testability. Each scenario becomes an acceptance test or chaos experiment. The availability example above is literally a zone-failure game day with two pass/fail measures.
  2. Hidden assumptions surface. Writing "Environment: Black Friday peak, warm caches" makes someone ask "and with cold caches after a deploy?", which is often the real worst case.
  3. Trade-off discovery. ATAM looks for sensitivity points: design decisions on which a quality attribute strongly depends, such as the replication mode of the order database. A trade-off point is a sensitivity point that affects two attributes in opposite directions. Synchronous cross-zone replication improves durability (RPO 0) but adds a few milliseconds to every write and may block writes if the standby is unreachable. The output of an evaluation is the list of these points plus the risks: decisions that may fail a high-priority scenario.

The utility tree described earlier ranks scenarios by business importance and technical difficulty, each rated high, medium or low. The scenarios rated high on both deserve design time first, both in reviews and in interviews.

Deep Dive: Allocating error and latency budgets across dependenciesShow

An end-to-end SLO is a budget that has to be shared between everything on the request path. Doing this allocation explicitly turns "99.9% availability" into concrete targets for each team.

Availability allocation. Take a checkout API with a 99.9% monthly SLO, an unavailability budget of 0.1% (about 43 minutes a month). Serial dependencies roughly add their unavailability when it is small, because 1 − Π(1 − uᵢ) ≈ Σ uᵢ. One reasonable split:

ContributorBudget (unavailability)Implied SLO
Edge: DNS, CDN, load balancer0.01%99.99%
Checkout service itself (bugs, bad deploys)0.04%99.96%
Orders database0.02%99.98%
Auth service0.02%99.98%
Reserve for the unexpected0.01%
Total0.10%99.9%

Now suppose the auth service only offers 99.9%. On its own it would use the entire budget. There are three options:

  • Ask the auth team for a better SLO, which costs them time and money.
  • Remove it from the critical path. Verify signed tokens locally, using JWTs with cached public keys, instead of calling the auth service on every request. Auth is then needed only at login, and checkout no longer depends on it.
  • Add a fallback, such as accepting recently validated sessions from a local cache during an auth outage.

The second option is usually best. This is the general lesson: you rarely buy availability by making a dependency better; you buy it by making the dependency unnecessary on the hot path.

Retries change the arithmetic, if failures are independent. If a dependency fails a given request with probability p because of transient faults, one retry makes the failure probability roughly p². At p = 0.1%, that is 0.0001%. This is why idempotent retries with backoff are so effective against transient errors, and almost useless against a hard outage, where every attempt fails together. Retries also add load, so cap them with a retry budget.

Latency allocation. For a serial chain, the sum of the p99s is a pessimistic bound on the end-to-end p99. Each step is rarely at its own p99 in the same request, so the real end-to-end p99 is usually lower. Budgeting with the sum is conservative and simple:

Stepp99 budget
Client to edge (network and TLS, warm connection)60 ms
Gateway and authentication (local token check)10 ms
Service logic30 ms
Database reads (2 sequential queries)2 × 25 ms
Cache lookups10 ms
Response back to client40 ms
Total200 ms

For parallel fan-out, the slowest call sets the time, so each leaf must meet a much stricter percentile than the parent. With 20 parallel calls and a parent target at p99, each leaf needs roughly its p99.95 within the budget, because 0.9995^20 ≈ 0.99. This is where hedged requests and partial results pay off.

Checking the budget in production. Distributed tracing such as OpenTelemetry can split real request time by span. Comparing each span's percentile to its budget tells you which team owns a latency regression.

Deep Dive: Cost as an NFR, a worked unit-economics modelShow

Cost is the NFR most often left out of designs, and the one that most often forces a redesign later. The method is to write the cost as a function of the main load drivers, find the dominant term and design against it.

Worked example: an image-sharing app with 10M monthly active users. The assumptions are illustrative, and the prices are the order of magnitude of public cloud list prices; check your provider:

  • Each user views about 50 images a day, about 200 KB each after resizing. That is 10 MB per user per day, about 300 MB per user per month.
  • 10% of users upload one photo a day: 1M uploads a day. Each original is 2 MB, with about 0.5 MB of resized renditions, so 2.5 TB a day of new storage, about 75 TB a month.
  • API traffic peaks at 20,000 requests per second.
Cost driverCalculationMonthly cost (rough)
CDN delivery10M × 0.3 GB = 3 PB; at about $0.02-0.05 per GB at high-volume rates$60,000-150,000
Object storageAbout 900 TB after a year; at about $0.023 per GB-month in a standard tierAbout $20,000 by month 12, growing every month
API compute20,000 RPS ÷ 1,000 RPS per instance × 2 headroom = 40 instances; at about $0.20 an hourAbout $6,000
Database, cache, queuesManaged services sized for the metadata$5,000-15,000

The total is about $0.01-0.02 per MAU per month, and the dominant term is clear: image delivery bandwidth, followed by storage that grows forever. Compute, which engineers usually optimise first, is under 10%.

The design levers follow directly:

  • Bytes per view. Modern formats such as WebP and AVIF are often 25-50% smaller than JPEG at similar quality. Serving the right size for each screen and lazy-loading images below the fold reduce bytes again. Each 10% saved here is worth more than the entire compute bill.
  • Cache hit ratio. Every miss costs origin egress plus the origin request. Pushing the CDN hit ratio from 90% to 98% cuts origin traffic by a factor of 5.
  • Storage lifecycle. Move originals older than 30-90 days to an infrequent-access or archive tier, which costs roughly half or much less. Keep only the renditions that are actually served, and regenerate rare sizes on demand.
  • Commitments. Committed-use or volume contracts for CDN and compute often cut list prices substantially once load is predictable.

The NFR that comes out of this is a unit-cost target: "Infrastructure cost under $0.015 per MAU per month at 10M MAU, and falling with scale." Tracked on a dashboard, it gets the same attention as latency. Cost per unit, not total cost, is the useful measure: a total bill that grows with users is healthy, while a cost per user that grows with users signals a design problem.

Key Takeaways#

  • Non-functional requirements decide the architecture; functional requirements decide the features.
  • Scalability is about a specific load parameter, such as requests per second, data size or fan-out, and growth in size, geography and administration.
  • Availability composes: serial dependencies multiply, parallel redundancy helps only if failures are independent, and fast recovery (MTTR) matters as much as rare failure.
  • Reliability means correct behaviour under faults; idempotency, transactions and reconciliation deliver it.
  • Describe latency with percentiles, merge histograms rather than averaging percentiles, and design for the tail in fan-out systems.
  • Throughput and latency are linked by Little's law; plan for headroom because queueing delay explodes near full utilisation.
  • Set consistency, durability (RPO and RTO), security and cost targets per data type and per journey, not for the whole system.
  • Express targets as SLIs and SLOs, and use the error budget and burn-rate alerts to balance speed of change against reliability.
  • Map each NFR to concrete mechanisms, and make sure every component traces back to an NFR.
  • NFRs conflict: rank them per journey, use a utility tree for the hard cases, and state your trade-offs out loud.
  • Pick the three to five NFRs that change the design, phrase each as "the system should..." with a number and a scope, and name what is out of scope.
  • Ask about scale first; estimate only when the result picks between designs; size for the peak, which is often about 10 times the average.
  • The read:write ratio often decides the architecture: caching and replicas at 1,000:1, log-based ingest for write-heavy systems.
  • "Never lose" and "never double count" travel together, so durability needs idempotency.
  • Environment, compliance, data-pipeline freshness and cost per unit are NFRs too, and each changes the design.
  • Prove NFRs with open-model load tests, chaos experiments, restore drills and fitness functions, then watch them with SLOs.