Sub topic 3
Maintainability and Operability Requirements
Assume you know basic client-server systems, databases, caching, and short Python programs. Maintainability describes how easily engineers can change and troubleshoot a system. Operability describes how easily operators can deploy, monitor, recover, and control it.
Useful requirements are measurable:
- A new engineer can run the service locally in under 15 minutes.
- A deployment can be rolled back in under 5 minutes.
- Every request has a correlation ID in application logs.
- An alert fires when the error rate exceeds 1% for 5 minutes.
- A backup restore test succeeds every quarter.
Estimating load and storage
Requirements should state the assumptions behind capacity estimates. For example, 10 million users making 20 requests per day produce about 2,315 average requests per second. A peak factor of three gives about 6,944 peak requests per second.
daily_users = 10_000_000
requests_per_user = 20
peak_factor = 3
bytes_per_record = 500
new_records_per_user = 1
requests_per_day = daily_users * requests_per_user
average_rps = requests_per_day / 86_400
peak_rps = average_rps * peak_factor
storage_gb = daily_users * new_records_per_user * bytes_per_record / 1_000_000_000
print(round(peak_rps), round(storage_gb, 1))Record whether figures include replication, indexes, backups, and growth. Otherwise, a precise-looking estimate can still under-size the system.
Trade-offs and architecture decisions
Requirements often conflict. Strong consistency can increase latency or reduce availability during network failures. More replicas improve read capacity and availability but increase storage cost and write complexity. Detailed audit logs improve security and debugging but require retention policies and extra storage.
Choose architecture from the required behavior, not from a preferred technology. A low-latency read target may justify a cache. A durability requirement may require replicated storage and confirmed writes. A short rollback target requires automated, versioned deployments.
>callout warning > Never hide a design decision inside an unstated assumption. State the assumption, its owner, and what happens if it changes. >end
Validating requirements
Check every requirement for clarity, testability, and consistency:
- Identify the actor, action, condition, and expected result.
- Replace vague words such as “fast” and “reliable” with measures.
- Check that targets use the same time window and workload.
- Test failure cases, not only successful requests.
- Ask stakeholders to approve scope and out-of-scope behavior.
Worked example: URL shortener
For a URL shortener, a compact requirement set might be:
functional:
- Create a short URL for a submitted long URL.
- Redirect a short URL to its long URL.
non_functional:
- 99% of redirects complete within 100 ms at the service edge.
- Redirect availability is 99.9% over 30 days.
- An acknowledged mapping is never lost.
operability:
- Rollback completes within 5 minutes.
out_of_scope:
- Click analyticsThe latency target suggests a cache for popular mappings. The durability target suggests replicated persistent storage. The availability target allows about 43.2 minutes of downtime in 30 days, which can guide recovery design.
Common mistakes
- Mixing features with quality targets.
- Writing “high availability” without a percentage or window.
- Estimating only average load and ignoring peaks.
- Omitting data growth, indexes, replicas, or backups.
- Choosing architecture before resolving requirements.
- Validating requirements only after implementation.
Exercise
A requirement says, “The API must be fast and easy to operate.” Rewrite it as two measurable requirements.
Show answer
For example: “99% of API requests complete within 200 ms over a representative seven-day workload,” and “A new release can be rolled back within five minutes using an automated procedure.”