Data Structures for Scale

Use geospatial indexes and probabilistic structures to make huge queries practical while understanding their error bounds.

Scale-oriented structures: spatial indexes locate nearby items; probabilistic sketches answer large-set questions cheaplyScale-oriented structures: spatial indexes locate nearby items; probabilistic sketches answer large-set questions cheaply

StructureUseful questionTrade-off
Geohash / S2 / H3What is near this location?Border cells need neighbor search
Quadtree / R-treeWhich shapes/points overlap this area?Rebalancing and skew
Bloom / Cuckoo filterIs an item definitely absent?False positives
HyperLogLogHow many distinct items?Approximate count
Count-Min SketchWhich keys are frequent?Overestimation
MinHashHow similar are two sets?Approximate similarity
Merkle treeWhich replicated blocks differ?Tree maintenance

Use an approximation only where its error is safe and measurable. Never use a Bloom-filter positive as proof of authorization or inventory ownership.