Ride-hailing and taxis
Nearby drivers are found in milliseconds, and an offer lock stops double booking.
Find the nearest drivers, stores or devices in a radius or a box, with live positions updated every few seconds.
Each update replaces the driver's previous position.
An animated walkthrough with real HotKV commands and example replies. Click any step to jump to it.
Matching a rider to the nearest driver, or a customer to the closest store with stock, needs a fresh view of thousands of moving positions and an answer in milliseconds. A relational database with spatial indexes struggles with that many updates per second.
Positions live in a geospatial index. Each driver updates their own position every few seconds with GEOADD, and GEOSEARCH returns everyone within a radius or a box, nearest first, with their distance. The same index answers store locator and delivery zone queries.
Each update replaces the driver's previous position.
GEOADD drivers:berlin 13.4050 52.5200 driver:17 13.3889 52.5170 driver:23Find the five nearest drivers within 3 km, nearest first.
GEOSEARCH drivers:berlin FROMLONLAT 13.4000 52.5190 BYRADIUS 3 km ASC COUNT 5 WITHDISTLock the driver so two riders cannot get the same car.
SET offer:driver:17 rider:42 NX EX 15Distance between two members of the index.
GEODIST drivers:berlin driver:17 driver:23 kmNearby drivers are found in milliseconds, and an offer lock stops double booking.
Couriers near a restaurant are matched as orders become ready.
Customers see the closest stores within a box around the map view.
GEOADD adds or updates members by longitude and latitude.
GEOADDAround a point or a member, sorted by distance, limited by count.
GEOSEARCHGEOSEARCHSTOREBetween members, in the unit you choose.
GEODISTGEOPOSRemove members and count them with the sorted set commands you know.
ZREMZCARDA geospatial index is a sorted set, so ZREM removes the member.
Yes. GEOSEARCH BYBOX takes a width and height around a point or a member.
Meters, kilometers, feet and miles.
HotKV speaks the Redis protocol, so you can point an existing client at it and run these same commands.