Uber is primarily a ride hailing service. It is a platform to connect riders to drivers so that the riders can reach their destination. Some of other platforms providing similar services are Ola, Lyft, Gojek, Via, Grab and Bolt.
Prerequisites:
System design introduction : 3 principles of distributed system, 5 step guide for System design.
System design concepts & components : Horizontal scaling, Database, Caching, Message queues, Communication protocols
Functional requirements
Non-functional requirements
Additional requirements
Rider to system apis :
Driver to system apis :
System to rider apis :
System to driver apis :
We will not be defining the data model as we have clearly defined it as addition requirement to save the data.
Consider we have 10 Million bookings per day. Each booking will generate at an average of 2MB of data.
So per day we will generate
10 Million * 2 MB = 20 Million MB = 20,000,000 Mb = 20,000 GB = 20 TB of data.
Let us see a simple design for the given problem statement.
What are the challenges we can see?
How to maintain the location data?
Existing libraries to maintain location data?
Steps in updated design :
We have 2 non-functional requirements.
1. The system should be reliable. It should always be up and running – This can be accomplished using the no single point of failure principle. Here we add redundant copies of each of the components.
2. The system should have high performance – This can be accomplished using the no bottleneck principle. We have to use Kafka queue and consistent hashing to divide the traffic.
Scaling location service?
RingPop design with SWIM protocol.