🔴 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.
More Redis Questions
View all →- Intermediate What is Redis Cluster and how does it shard data?
- Intermediate What is the difference between Redis Sentinel and Redis Cluster?
- Intermediate How do MULTI and EXEC work in Redis transactions?
- Intermediate What is WATCH and optimistic locking in Redis?
- Intermediate What is Lua scripting in Redis and when should you use it?