What is near me (geohash cells, and fences by ray casting)
Geospatial Index & Places · Open board
The globe pre-divided into cells, so “coffee near me” becomes your cell and its neighbours instead of every place on Earth.
Before you start. You need the six steps from Design the Whole Thing (the interview, assembled): ask, estimate, API, data, design, bottlenecks, with nothing drawn until a number pays for it. Four Systems in One Night (worked designs) showed that the biggest number in a prompt names the hinge of the design. Later in this track, Design Uber, in the interview uses a grid of cells to find cars, and Google Maps, the case study names Google’s version of it in one paragraph. This lesson builds that grid from scratch, so you meet the idea working before either of them.
Lesson 69 of 115 in System Design
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.
See plansAlready a member? Sign in
Or start free: a free account opens lessons 2 and 3 of every track.
In this lesson
- 26 February 2008: a place becomes five letters
- Cutting the map in half, again and again: the cell
- The prefix: the first letters name the big cell
- A cell id is a prefix lookup
- 50 metres apart, different cells: the boundary problem
- The 9-cell search
- Two later answers: S2 and H3
- A fence is a shape, not a box: geofence and ray casting
- 1. Requirements
- 2. Out of scope, said out loud
- 3. Targets
- 4. Estimates that change the design
- 5. Entities and API
- 6. Storage, with the trade said plainly
- 7. The design, one requirement at a time
- 8. Deep dives
- 9. What each level adds
- 10. The follow-up: the 10 nearest, with no radius
Terms it explains: bit, cell, geohash, prefix, prefix lookup, boundary problem, geofence, ray casting, Common mistakes.
Review System Design
Saved in this browser, and to your account when you sign in.