Back to feed
Dev.to
Dev.to
6/15/2026
Uber finds nearest drivers in

Uber finds nearest drivers in

Original: System Design - 24. Geospatial Indexing: How Uber Finds the Nearest Driver Among Millions in Milliseconds

Short summary

Finding millions of nearby drivers in real-time requires converting 2D geospatial queries into 1D database operations. Quadtrees recursively subdivide space by density, Geohash encodes coordinates as prefix-searchable strings, and Google S2 maps Earth onto a cube. Each approach trades simplicity for accuracy and scale.

  • Naive SQL distance calculations don't scale — need specialized geospatial indexing
  • Quadtrees, Geohash, and S2 are the three major approaches with different trade-offs
  • Converting 2D nearby queries to 1D database operations enables efficient real-time lookup

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Explore more