Failure Modes and Edge Cases in Geohash Systems
Boundary Discontinuity
At certain boundaries, adjacent cells have completely different prefixes. Two points 1 meter apart might have geohashes that share no common prefix. This happens at the prime meridian, equator, and at boundaries where Z-order curve jumps.
Impact: prefix queries miss nearby points across these boundaries. A query for "9q%" misses points in "dr%" even if they are adjacent. The fix is always using neighbor expansion, which handles these cases automatically by explicitly querying adjacent cells.
Precision Mismatch
Storing points at one precision and querying at another causes problems. If points are stored with 8 character geohashes but you query for 6 character prefixes, you get correct results. But if stored at 6 characters and you need 8 character precision, you cannot get it without re-encoding from original coordinates.
Store original lat/lon alongside geohash. The geohash enables fast queries. The coordinates enable precise calculations and re-encoding at different precisions if requirements change.
Hot Cell Problem
Popular locations concentrate in certain cells. A city center cell contains millions of points and receives most queries. This cell becomes a hot spot: high read load, potential for lock contention, uneven data distribution across shards.
Solutions include finer precision (smaller cells distribute load), sub-sharding hot cells, caching frequently accessed cells, or using composite keys that add randomness within cells. Monitor cell access patterns to identify emerging hot spots.