Requirements Scope and Measurable Service Targets

Requirements and the Design Framework · 35 min

System Design · Module 1 · Lesson 2 of 4 · 35 min

Requirements Scope and Measurable Service Targets

Turn vague product language into a scope box, correctness rules, a workload and measurable latency and availability targets.

A requirement is reviewable when you can describe the workload and a test that would prove it was violated.

01 The idea

The problem this lesson solves

The prompt says the link service must be fast and highly available.

Prerequisite: earlier lessons introduce the vocabulary and shared examples used here. Follow the module order.

Functional requirementAn action the product must support.
SLOA service-level objective: a target for a defined measured service indicator.
PercentileA value below which a specified fraction of observations falls, such as p99 latency.

02 Worked example

Follow one worked example

Requirements Scope and Measurable Service Targets worked diagram01User actionWhat must happen?02WorkloadHow much traffic?03IndicatorWhat do we measure?04ObjectiveWhat counts as good?Requirements Scope and Measurable Service Targets compact diagram01User actionWhat must happen?02WorkloadHow much traffic?03IndicatorWhat do we measure?04ObjectiveWhat counts as good?
User action: What must happen? • Workload: How much traffic? • Indicator: What do we measure? • Objective: What counts as good?.

Trace the example in order. Follow the same identities, units and state transitions through the diagram and the events below.

1
Start vagueThe prompt says the link service must be fast and highly available.
2
Make scope explicitInclude creating and following links; defer analytics and custom domains.
3
Choose measurable targetsAssume 500 QPS, p99 below 200 ms at the gateway, and 99.9% good requests over 30 days.
4
Add an invariantA successful creation must return a unique stored code and remain recoverable after app restart.

A requirement is reviewable when you can describe the workload and a test that would prove it was violated.

03 The method

Mechanisms decisions and a guided tutorial

Work through the explanation in order, then apply it in the tutorial. Each comparison names a cost as well as a benefit.

Choice or conceptPurposeBoundary or cost
FeatureCreate a short linkBehavior and authorization test
Latencyp99 below a targetBoundary, workload and distribution
AvailabilityFraction of good eventsWindow and denominator
InvariantUnique ownershipConcurrent and failure tests

Step 1: write the scope box

State what clients can do, what you will deliberately defer, and what success means. For our example: authenticated clients call an API; each client gets at most 3 accepted requests in a fixed 60-second window across all application instances. Excess requests receive HTTP 429. Assume a single region, 100 active clients, and a target of 10 milliseconds added latency at the 99th percentile. These are exercise assumptions. Abuse detection, billing and global fairness are outside this first design.

Make non-functional targets measurable

‘Fast’ is not a test. ‘99 percent of decisions finish within 10 milliseconds at 100 requests per second’ is testable. Latency is the time for one request; throughput is completed requests per unit time. Availability describes successful service over a defined period. If you use a time-based target, 99.9 percent availability permits 43.2 minutes of downtime in a 30-day month: 30 × 24 × 60 × 0.001. A request-based service-level objective measures successful requests instead, so always state the denominator.

Write the workload beside the target

“Responses below 200 ms” needs a scope. Is it an average, a percentile or every request? Is it measured at the browser, the gateway or the application? Does it include failed requests? Write these boundaries before comparing architectures.

For a redirect service, an example objective is 99 percent of valid redirect requests completed within 200 ms at the gateway under 500 requests per second in one region. The numbers are exercise inputs. A monitoring query and a load-test report can now assess that sentence. Without the boundary, two teams may both report 200 ms while measuring different parts of the request.

Separate correctness from service quality

“One active booking for each seat and show” is an invariant. “The booking endpoint responds within 500 ms” is a latency objective. A fast response that books the wrong seat is not a successful operation. Define a success event using both protocol and business meaning.

Write an in-scope list and an out-of-scope list. For a first short-link design, create and redirect can be in scope while analytics and custom domains are deferred. Scope controls the rest of the discussion: a globally replicated analytics pipeline does not solve a requirement that was deliberately excluded.

Translate availability into a budget carefully

A time-based 99.9 percent objective for thirty days permits 43.2 minutes unavailable. A request-based objective counts good requests divided by eligible requests. These can disagree when traffic is uneven: a short outage at the busiest moment may affect more requests than a longer quiet-period outage.

Define which requests are eligible and what constitutes a good response. Client mistakes may be excluded, but a server-side 500 must not disappear from the denominator merely because it makes the dashboard less attractive. Choose a window and state how partial failures are counted before designing alerts.

Guided tutorial

1. Draft a requirements table

Use columns requirement, measurement boundary, test and assumption.

2. Inspect one percentile

Sort 100 example latency values; explain which observation represents the chosen percentile convention.

3. Compare denominators

Describe a quiet-hour and a peak-hour outage with equal duration.

4. Resolve an ambiguity

Decide whether a database timeout is a bad eligible request in your service objective.

scope: create links, follow links
workload: 500 redirect requests/second, one region
latency: p99 below 200 ms, measured at the gateway
availability: good / eligible requests >= 0.999 over 30 days
correctness: a successful create has one durable unique code

04 Cheat sheet

Review the decisions

Use this table to explain the mechanism and its limit without memorizing a product name.

Choice or conceptRememberCheck
FeatureCreate a short linkBehavior and authorization test
Latencyp99 below a targetBoundary, workload and distribution
AvailabilityFraction of good eventsWindow and denominator
InvariantUnique ownershipConcurrent and failure tests
Functional requirementAn action the product must support.
SLOA service-level objective: a target for a defined measured service indicator.
PercentileA value below which a specified fraction of observations falls, such as p99 latency.

05 Where & why

Check the primary references

Use official references for protocol and implementation details. The questions here are teaching prompts.

Primary reference
HTTP 429

Read HTTP 429

Primary reference
Redis atomic scripting

Read Redis atomic scripting

State the implementation version and the workload assumptions when defending your own design.

06 Interview questions

Explain the reasoning out loud

Answer before opening the explanation. The questions progress from vocabulary to decisions and failure behavior.

What does Functional requirement mean?
An action the product must support.
What does SLO mean?
A service-level objective: a target for a defined measured service indicator.
What does Percentile mean?
A value below which a specified fraction of observations falls, such as p99 latency.
Why is average latency insufficient?
Averages can hide a small group of very slow requests. A percentile objective makes the relevant tail visible, while still requiring a defined workload and measurement boundary.
What belongs in a scope box?
The supported user actions, excluded features, scale assumptions, correctness rules and service targets. It should be short enough to revisit when a new requirement appears.
Are time-based and request-based availability equivalent?
No. They weight failures differently when traffic varies. State the indicator rather than quoting a percentage without its denominator.
Can every response with HTTP 200 count as success?
Only if it also fulfills the business contract. Returning an empty result after an internal failure can make the status look good while the service fails the user.
What do you do when no target is supplied?
Propose explicit exercise assumptions, ask for corrections and proceed. Keep them visible so later design choices can be revised coherently.

07 Practice problems

Practice a new case

Solve the new cases before revealing hints. Complete worked solutions follow the set.

Classify a target

Easy
Classify exporting CSV and keeping p95 export-start latency below 1 second.
Follow-up
State the assumption or edge case that makes the answer correct.
Show the hint
Separate behavior from quality.

Find ambiguity

Easy
Name two missing details in “the API is 99.99% available.”
Follow-up
State the assumption or edge case that makes the answer correct.
Show the hint
Ask what is counted and over what period.

Downtime arithmetic

Medium
Calculate the time budget for 99.95% over a 28-day month.
Follow-up
State the assumption or edge case that makes the answer correct.
Show the hint
Convert the full window to minutes.

Request arithmetic

Medium
For 200,000 eligible requests at a 99.9% objective, find the allowed bad-request count.
Follow-up
State the assumption or edge case that makes the answer correct.
Show the hint
Use the complement of the success fraction.

Define business success

Medium
Define a good event for a booking confirmation endpoint.
Follow-up
State the assumption or edge case that makes the answer correct.
Show the hint
Include the invariant, not just response timing.

Resolve conflicting targets

Hard
A product asks for instant global updates and continued writes through any network partition; write a clarification note.
Follow-up
State the assumption or edge case that makes the answer correct.
Show the hint
Identify the desired behavior when regions cannot communicate.

Worked solutions

1. Classify a target

CSV export is functional. The p95 target is a performance objective and needs a workload and measurement boundary.

2. Find ambiguity

The service indicator and observation window are missing. Also clarify eligible requests, success semantics and whether the indicator is time-based or request-based.

3. Downtime arithmetic

28 × 24 × 60 = 40,320 minutes; 0.05% unavailable permits 20.16 minutes.

4. Request arithmetic

0.1% of 200,000 is 200 bad requests. This is a count budget for the chosen window, not a duration budget.

5. Define business success

A good event returns the documented response within the target and confirms ownership of the correct seat under the booking contract. Internal errors and false confirmations are bad events.

6. Resolve conflicting targets

Ask which operations require immediate agreement, which can be temporarily unavailable, and which can accept conflicts or staleness. Specify the partition behavior per operation before promising both targets together.