API Maker
The backend engine for the AI era
Case study 08 · Real-time & WebSockets
FreshDash delivers groceries in 30 minutes across Riyadh and Jeddah. Customers want to watch the rider come, and dark stores want to see an order the second it lands. FreshDash replaced polling with the WebSockets and events of API Maker, and the live map now updates in under 200 ms at the evening peak.
The challenge
FreshDash promises groceries in 30 minutes. For a customer waiting at the door, the most opened screen of the app is the map with the rider on it. Until 2025 that map asked the server every 10 seconds where the rider was. With 20,000 open screens at 8 pm, that was 2,000 requests a second asking the same question, and mostly getting the same answer.
The dark stores had the same problem the other way round. Their tablets refreshed the list of orders every 15 seconds, so a new order could wait 15 seconds before anyone started picking it. In a 30-minute promise, that is a long time.
The solution
The catalog APIs of FreshDash already ran on API Maker. Its WebSockets and events were the missing piece: the server tells the screens when something changes, instead of the screens asking. The rider app keeps posting its location, and the server pushes it to the people who watch that order, and to nobody else.
The rider app posts its GPS every 3 seconds. A listener checks the order and sends the location on as a custom WebSocket event.
Events & ListenersEach customer screen registers for that event with a condition on its own order. A location reaches the customer and the store of that order: 2 screens, not 22,000.
WebSocketsStore tablets register for the orders API with a condition on their store. When an order is paid, its store hears about it at once.
A scheduler checks every minute for orders running late, and alerts the store lead before the customer notices.
SchedulersThree API Maker servers share the connections behind a load balancer. Redis carries the messages between them, so a location posted to one server reaches a screen held by another.
The numbers
The same evening of the week, one month apart, with 9% more orders.
Measured on the 95th percentile of the evening peak.
The results
Our customers do not read our delivery time, they watch the rider. Since the map moves smoothly they trust it, and they stopped writing to support to ask.
What comes next. FreshDash is adding live stock: when a store runs out of an item, the apps of the customers around it will hide the item within a second.
Try API Maker on your own computer for free, or tell us about your project.