Question
Design the backend for a 'find places near me' feature over 100M static points of interest (restaurants, shops, etc.). A query gives a lat/lng and a radius (or a 'top 20 nearest open now'), and POI density is wildly uneven — thousands of venues in a dense downtown block, almost none in rural areas. Queries must return in <100ms and the result must be filterable (open now, category, rating). Most data is read-heavy and changes slowly. Describe the spatial index, why a density-adaptive structure helps here, how you combine spatial with attribute filters, and the read-scaling approach.
Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts — data model, bottlenecks, consistency, failure modes — and name the trade-offs you are making.