🔴 Redis Intermediate

What are Redis Geospatial commands?

Answer

Redis has built-in geospatial support using a Sorted Set internally, where the score is a Geohash encoding of the longitude and latitude. GEOADD key lon lat member adds a location. GEODIST key member1 member2 [unit] returns the distance between two members in meters, kilometers, miles, or feet. GEOPOS key member returns the coordinates of a member. GEORADIUS and GEOSEARCH (Redis 6.2+, preferred) find members within a given radius of a point or bounding box, with optional sorting and limiting. Practical use cases: finding nearby stores, drivers, or restaurants within 5km; proximity-based matching in ride-sharing apps; location-aware search. The underlying Geohash provides approximately 0.6m precision at maximum resolution.