Design Uber Eats (Online Food Delivery Platform)
Problem Statement
Design a scalable online food delivery system like Uber Eats, which enables users to:
The system should handle millions of users, restaurants, and delivery partners with high availability, low latency, and strong fault tolerance.
🎯 Functional Requirements:
⚙️ Non-Functional Requirements:
🧱 Core Components:
ServiceResponsibility
API Gateway
Routes user/partner requests
User Service
User auth, profile, preferences
Restaurant Service
Menus, hours, availability
Search & Discovery
Nearby restaurants, filters
Cart & Order Service
Order placement, status, cart mgmt
Delivery Service
Delivery assignment, route tracking
Payment Service
Payments, refunds, reconciliation
Notification Service
Real-time updates (SMS/email/push)
Rating & Review Service
Post-delivery feedback
Tracking & Location Service
Geolocation of user, restaurant, and driver
📍 Key Flows:
1. Order Placement Flow:
User → Browse menu → Add to cart → Checkout
→ Payment → Order created → Restaurant notified → Delivery assigned
→ Track order (WebSocket/polling)
2. Delivery Assignment Flow:
3. Real-Time Tracking Flow:
🛒 Database Design (Simplified)
Users
1pgsql
2CopyEdit
3user_id | name | location | preferences | contact_infoRestaurants
1pgsql
2CopyEdit
3restaurant_id | name | location | is_open | cuisine | ratingMenu_Items
1nginx
2CopyEdit
3item_id | restaurant_id | name | price | availability | categoryOrders
1lua
2CopyEdit
3order_id | user_id | restaurant_id | status | total_amount | payment_status | timestampDelivery
1nginx
2CopyEdit
3delivery_id | order_id | driver_id | pickup_eta | delivery_eta | current_location🧠 Scalability Considerations:
🧰 Tech Stack (Suggested):
LayerTools & Tech
Backend Services
Node.js / Go / Java
Data Storage
PostgreSQL + Redis + Cassandra
Real-Time Tracking
WebSockets + MQTT
Queue
Kafka / RabbitMQ
Search
Elasticsearch for restaurant discovery
Payments
Razorpay / Stripe / PayPal
Location Services
Google Maps API / Mapbox
CDN/Image Delivery
CloudFront, Imgix
🧠 Optional Features to Extend: