What happens if a global content delivery platform sets a quality-attribute target of "cache hit ratio above 95%" and simultaneously "content updates visible worldwide within 5 seconds"? Explain the conflict and how it is normally resolved.
Show the full answer Hide the answer
The conflict
The two targets pull in opposite directions through the same knob: time to live.
A high hit ratio wants long TTLs — objects served many times from the edge before anyone returns to origin. Five-second global visibility wants short TTLs — constant revalidation. Set TTL to five seconds across a large catalogue and hit ratio collapses while origin load multiplies. Set it to an hour and the freshness target is violated by up to an hour.
Stated as raw numbers, the pair is unsatisfiable — and the useful move is noticing that before building rather than during the first incident.
Why the conflict is productive
Quality attributes are only useful when specific enough to conflict. "Fast" and "fresh" never argue. "95% hit ratio" and "5-second propagation" argue immediately, which forces the question nobody had asked: fresh for which content?
How it resolves in practice
The resolution is almost never a compromise TTL. It is a decomposition:
- Split the catalogue by change profile. Immutable, content-addressed assets (versioned bundles, media segments) get very long TTLs and near-total hit ratios. Mutable objects — a homepage, a price, a live scoreboard — are a small fraction of requests and get short TTLs.
- Replace time-based expiry with event-based purge. Publishing pushes an invalidation, so freshness is bounded by propagation time rather than TTL, and TTLs can stay long.
- Serve stale while revalidating. The edge answers instantly from the stale copy and refreshes behind the request, bounding freshness lag without paying origin latency on the read path.
- Restate the target per class. "Immutable assets: hit ratio > 98%. Mutable pages: purge propagation p99 < 5s." Now both are testable and neither is a lie.
The transferable lesson
When two quality attributes conflict, the first question is not "which wins" but "am I applying both to the same objects?" Most apparent trade-offs dissolve once the workload is segmented. The ones that survive segmentation are real, and worth escalating to whoever can accept the cost.