High-level Design of Uber
In this lesson1 sections
High-level Design of Uber
Follow a ride request from tentative driver discovery to a committed assignment. The API sketches describe the operations; an implementation also needs request identities, version checks, and rules for retries.
Workflow of our application
Before designing the architecture, let’s outline the application workflow:
When the rider opens the app, show a recent view of nearby eligible drivers. This is a discovery view, not a reservation.
The rider chooses a destination and submits a request with a stable retry identity.
The service creates a pending request and selects an eligible driver.
The rider sees “Waiting for driver” while the offer is pending.
Drivers send timestamped location updates at the exercise’s four-second interval. Discard or separately retain stale updates rather than letting them overwrite newer positions.
Reserve and confirm the assignment through an authoritative state transition. If the driver declines or the offer expires, release it and try another eligible driver. A late acceptance must not revive an expired offer or create a second assignment.
The rest of this lesson is for Premium members
Premium opens every lesson in this course, along with all questions and solutions on PracHub.