MSD-101 ยท Global taxi booking design
Rider app and driver app
โฑ 10 min ๐ฎ Hands-on โ Azure โ Completed
โก The 30-second answer
A taxi platform has two mobile apps with very different jobs. The rider app is light: short sessions, location only while open, push when in the background. The driver app runs for 10-hour shifts, sends GPS with the screen off, buffers points offline and must protect the battery, so it is built as a separate app on a shared core.
- Rider screen flow
- Driver screen flow
- Background location rules
- One app or two
Try it
Play with the design before you read about it. Everything runs on this page.
Rider app
- Local DB + outboxActive trip, saved places, unsent commands.
- Realtime clientWebSocket only while a trip screen is open.
- Push handlerโDriver arrivedโ when the app is in the background.
- Payment SDKCard goes to the payment provider; we keep a token.
- Locale + remote configLanguage, currency, ride types per country.
- Secure token storeKeychain / Keystore, one refresher.
Driver app
- Location engineForeground service (Android) / background location (iOS). Interval changes by state.
- GPS bufferKeeps up to 5 min of points offline, sends oldest first.
- Offer handler15 s countdown, accept is an idempotent command.
- NavigationRoutes from Azure Maps, or hand-off to the phoneโs map app.
- Trip state machineCan finish a trip offline; the server confirms later.
- Battery guardLowers GPS rate when battery < 20% and not on a trip.
| ๐ Rider app | ๐ Driver app | |
|---|---|---|
| ๐ GPS | Only on map screens | Always while online: 15 s idle, 4 s on trip |
| โธ๏ธ Background | Push only; sockets close | Must keep running: foreground service / background location |
| ๐ Battery | Small, short sessions | 10-hour shifts; the biggest design constraint |
| ๐ด Offline | Booking survives in the outbox | Buffers GPS, can end a trip offline |
| ๐ Push | โDriver arrivedโ, receipts | New offers when the app is in the background |
| ๐ Permissions | Location while using | Background location: extra app store review |
| ๐ฅ Users | Millions, casual | Thousands per city, daily, often low-end phones |
๐ค Riders and drivers do very different things. One app with two modes, or two separate apps?
Compare all three side by side
| Approach | Pros | Cons | When to choose |
|---|---|---|---|
| One app, two modes | One codebase, one store listing. | Every rider downloads driver code and is asked for background location. Store review gets harder. | A very early pilot with a handful of drivers. |
| Two apps, shared core | Right permissions for each, smaller rider app, release each on its own schedule. | Two store listings and pipelines to run. | Almost always: this is what real ride apps do. |
| Driver app as a web page | No app store review. | Browsers cannot keep GPS running in the background, and pushes are limited. | Never for live tracking. Fine for a driver sign-up form. |
โ Build two apps on a shared core: a light rider app, and a driver app that owns background location, battery rules and offline trips.
- The problemA driver starts a shift at 7 am with a full battery. By 11 am the phone is at 15% and the app is asking for location โall the timeโ. Riders, meanwhile, complain the rider app wants background location too.
- The design ideaTwo users, two apps, one shared core.
- In real lifeLarge ride and delivery companies ship separate customer and partner apps. Partner apps often target low-cost Android phones, so they keep memory use low and cache map tiles.
Start with a question
A driver starts a shift at 7 am with a full battery. By 11 am the phone is at 15% and the app is asking for location โall the timeโ. Riders, meanwhile, complain the rider app wants background location too.
The two apps share a trip but not their constraints. Treating them as one app hurts both.
Explain it like I'm 10
A pizza shop has a customer menu and a kitchen screen. Both see the same order, but the kitchen screen stays on all day and the customer menu is opened for two minutes. You would not build them the same way.
The technical explanation
Rider app: cars near you โ set drop-off โ choose a ride โ finding your driver โ driver on the way โ on trip โ pay and rate. It needs location only on map screens, a WebSocket only while a trip screen is open, and push for โdriver arrivedโ.
Driver app: go online โ offer with a 15 s countdown โ go to pickup โ rider picked up โ trip โ earnings. It must keep sending GPS with the screen off: an Android foreground service with a visible notification, or iOS background location mode.
The driver app changes the GPS interval by state (15โ30 s idle, 4 s on a trip), buffers up to 5 minutes of points offline, and can finish a trip offline while the server confirms later.
Build two apps on a shared core (API client, auth, models, design system). Riders never see a background-location prompt, the rider app stays small, and each app ships on its own schedule.
| Aspect | Rider app | Driver app |
|---|---|---|
| GPS | Only on map screens | 15 s idle, 4 s on trip |
| Background | Push only | Foreground service / background location |
| Battery | Short sessions | 10-hour shifts |
| Offline | Booking in the outbox | GPS buffer, end trip offline |
| Permissions | Location while using | Background location (extra review) |
Real-world scenario
Large ride and delivery companies ship separate customer and partner apps. Partner apps often target low-cost Android phones, so they keep memory use low and cache map tiles.
Test yourself
5 questions. Get 4 right and this lesson is marked complete.
Pass the quiz to complete this lesson.
Next: One app, many countries โQuestions people ask
How do I keep the driver app sending GPS with the screen off?
Android: a foreground service with a visible notification. iOS: background location mode. Lower the rate when idle, buffer points offline, and expect the store review to ask why you need it.
Should a taxi app be one app or two?
Two apps on a shared core library. Riders and drivers need different permissions, battery rules and release schedules.
Does the rider app need background location?
No. The rider app needs location only while a map screen is open, and uses push notifications when it is in the background. Asking riders for background location scares users and slows app store review.
How do I save battery in a taxi driver app?
Change the GPS interval by trip state: about every 4 s on the way to a pickup or on a trip, every 15โ30 s while waiting. Batch points when the signal is weak, and lower the rate when the battery is low.
Interview questions
How this topic comes up in system design interviews. Answer out loud first, then open the model answer.
beginner Name three differences between a rider app and a driver app.
Driver app runs in the background for hours, sends GPS continuously and must work offline mid-trip; the rider app is short-lived and relies on push in the background.
intermediate How would you reduce battery drain in the driver app?
Change GPS interval and accuracy by state, batch points when the signal is weak, avoid wake-ups when idle, and lower the rate when battery is low and the driver is not on a trip.
advanced A driver ends a trip while offline. How do you make the fare correct?
The app records the end event and buffered GPS points in its outbox with an idempotency key. When online it sends them; the server computes the fare from the route, confirms, and the app shows the serverโs fare.
Quick revision
Remember
- Rider screen flow
- Driver screen flow
- Background location rules
- One app or two
- Write the app store โwhy we need background locationโ text on day one. If you cannot explain it in two sentences, the reviewer will not accept it either.
One line to remember
โTwo users, two apps, one shared core.โ
Official documentation
- Azure Maps (Microsoft Learn)
- Azure Notification Hubs (Microsoft Learn)