Latency percentile aggregation
Your task
Design how a metrics platform records and serves latency percentiles for 100,000 service endpoints. Engineers want p50/p90/p99/p99.9 for any endpoint, and crucially want to aggregate percentiles across arbitrary groupings (all endpoints in a region, a whole service) computed on the fly. Averaging stored per-endpoint percentiles is mathematically wrong, but storing every raw latency is too expensive. Design the data representation, the aggregation, and the accuracy/cost trade-off.
It covers
- Histograms
- Percentiles
- Aggregation