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.
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.
02 Worked example
Follow one worked example
Trace the example in order. Follow the same identities, units and state transitions through the diagram and the events below.
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 concept | Purpose | Boundary or cost |
|---|---|---|
| Feature | Create a short link | Behavior and authorization test |
| Latency | p99 below a target | Boundary, workload and distribution |
| Availability | Fraction of good events | Window and denominator |
| Invariant | Unique ownership | Concurrent 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 code04 Cheat sheet
Review the decisions
Use this table to explain the mechanism and its limit without memorizing a product name.
| Choice or concept | Remember | Check |
|---|---|---|
| Feature | Create a short link | Behavior and authorization test |
| Latency | p99 below a target | Boundary, workload and distribution |
| Availability | Fraction of good events | Window and denominator |
| Invariant | Unique ownership | Concurrent and failure tests |
05 Where & why
Check the primary references
Use official references for protocol and implementation details. The questions here are teaching prompts.
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?
What does SLO mean?
What does Percentile mean?
Why is average latency insufficient?
What belongs in a scope box?
Are time-based and request-based availability equivalent?
Can every response with HTTP 200 count as success?
What do you do when no target is supplied?
07 Practice problems
Practice a new case
Solve the new cases before revealing hints. Complete worked solutions follow the set.
Classify a target
EasyShow the hint
Find ambiguity
EasyShow the hint
Downtime arithmetic
MediumShow the hint
Request arithmetic
MediumShow the hint
Define business success
MediumShow the hint
Resolve conflicting targets
HardShow the hint
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.