Why architecture matters here
Reservoir sampling fails on bad RNG, wrong weighted math, or naive parallel merge. Architecture matters because guarantees depend on details.
Advertisement
The architecture: every piece explained
The top strip is basics. Stream. Reservoir size k. Algorithm R — coin flip per item. Vitter — geometric jump.
The middle row is variants. Weighted (A-Res) — priority. Distributed — per-shard reservoirs merged. Streaming APIs — top-K queries. Guarantees uniform or weighted.
The lower rows are practice. Use cases log sampling + trace. Metrics variance. Ops RNG + audit + composition.
Advertisement
End-to-end flow
End-to-end: log pipeline produces 1M events/min. Sample 1000 uniformly. Algorithm R per shard; merge preserves uniformity. Weighted variant used for prioritized sampling of errors.