Optimize the right things: critical paths, p95 latency, and user perception
Users don’t experience averages — they experience the slowest moments. Architecture decisions should focus on p95/p99 latency and perceived performance.
Every system has a critical path: the chain of steps that determines user-perceived speed.
Architecture decisions should:
Users care about time to first meaningful result more than total time.
Examples:
Set a budget and enforce it:
Budgets turn “performance” into enforceable constraints.
Q: Why do p95/p99 metrics matter more than averages?
<details> <summary>💡 Reveal Answer</summary>Because users feel the slowest requests. Averages hide tail latency. If p95 is bad, many users will perceive the system as slow even if the average looks fine.
</details>Measure a critical path:
Your analytics enrichment adds 400ms to every API response. Product wants it on every request.
<details> <summary>Best approach</summary> </details>Full access
Unlock all 12 lessons, templates, and resources for Software Architecture & Decision Patterns. Free.
How do you handle it?
Move enrichment off the critical path: return the core response fast, then update analytics asynchronously. If product needs it for UI, precompute or cache the enrichment instead of blocking every request.
| Idea | Remember This |
|---|---|
| Tail latency | p95/p99 matter more than averages |
| Critical path | Remove work from the path |
| Perception | Fast feedback beats complete data |
| Budgets | Set and enforce performance targets |
Next: Evolving Architecture: Refactor, Strangle, Replace