Sub topic 8
How dependencies in series lower availability
This chapter assumes you can read short Python snippets, multiply probabilities, and describe a basic client-server request path. You should also know that availability is the fraction of time or requests for which a service works correctly, and that "the nines" state that fraction.
The core rule
A request often passes through several components in a row: a load balancer, an application server, a database. If the request needs every one of them, they are in series. The request succeeds only when all of them work.
If failures are independent, the availability of the whole chain is the product of the individual availabilities.
from math import prod
def series(*availabilities):
return prod(availabilities)
print(series(0.999, 0.999, 0.999)) # about 0.997003, roughly 99.70%Three components at 99.9% each give about 99.70%. The chain is worse than its weakest link, because every link adds its own chance of failure.
Why the loss adds up
For high-availability components, the product is close to subtracting the unavailabilities. Each 99.9% component is down 0.1% of the time. Three of them are down about 0.3% of the time, so the chain is near 99.7%.
This gives a quick estimate: add up the downtime fractions of the components in series.
| Components at 99.9% each | Combined availability | Downtime per 30 days |
|---|---|---|
| 1 | 99.900% | 43.2 min |
| 3 | about 99.700% | about 129.5 min |
| 5 | about 99.501% | about 215.6 min |
| 10 | about 99.004% | about 429.5 min |
Ten components at three nines each land near two nines. A system cannot be more available than its least available serial dependency, and in practice it is noticeably less.
Working backward from a target
Suppose you promise 99.9% and your request path has five serial components. If they are equal, each one needs to be better than 99.9%. You can solve for the required value with a root.
def required_each(target, n):
return target ** (1 / n)
print(f"{required_each(0.999, 5):.5f}") # 0.99980Each component needs about 99.98%. Targets for dependencies must be stricter than the target for the service that uses them. A common mistake is to build on dependencies that are only as good as the promise you make to your own users.
Hidden serial dependencies
The diagram you draw is rarely the full list. Check for these:
- DNS resolution and TLS certificate renewal.
- Authentication or authorization services called on every request.
- Configuration or feature-flag services read at request time.
- Third-party APIs, such as payment or email providers.
- The network paths between components.
A dependency that is called on every request is a serial dependency, even if it looks like a side detail. A dependency that is only used on some requests affects only those requests. A dependency whose failure you handle gracefully, for example by serving cached data, is no longer strictly in series for that behavior.
Common errors
- Averaging instead of multiplying. Three components at 99.9% do not give 99.9%. Multiply them.
- Ignoring correlation. The product assumes independent failures. If two components share a power source or a deployment pipeline, they tend to fail together. Failing together makes the true series figure better than the product suggests, but it makes the parallel figure in the next chapter worse.
- Forgetting the dependency's SLA is not your SLO. A vendor's contract promise is often a floor, and credit payments do not restore lost user trust.
Reducing the penalty
You can limit the effect of series dependencies in three ways:
- Remove a component from the request path, for example by moving work to a background job.
- Make a dependency optional, with a fallback such as a cache or a default value.
- Improve the component's availability, either directly or by adding redundancy, which the next chapter covers.
Exercise
A request passes through a load balancer (99.99%), an application tier (99.95%), and a database (99.9%), all required and independent. What is the combined availability, and about how many minutes of downtime does that allow per 30 days?
Show answer
Multiply: 0.9999 × 0.9995 × 0.999 ≈ 0.99840, or about 99.84%. The unavailable fraction is about 0.0016, and 0.0016 × 43,200 minutes ≈ 69 minutes per 30 days. The database, the weakest link, accounts for most of it.