
π Food Delivery & QSR Β· Database ERD
A schema for a food delivery platform: restaurants, menus, items with add-ons, customers, orders, order items and riders.
Drawing diagramβ¦
ERD for food delivery: Restaurant has MenuCategories with MenuItems; MenuItem has AddOnGroups with AddOns (extra cheese); Customer places Orders at a Restaurant; Order has OrderItems (with selected add-ons and price at order time); Rider is assigned to Orders; Address stores delivery locations.
erDiagram
RESTAURANT ||--|{ MENU_CATEGORY : has
MENU_CATEGORY ||--|{ MENU_ITEM : lists
MENU_ITEM ||--o{ ADDON_GROUP : offers
ADDON_GROUP ||--|{ ADDON : contains
CUSTOMER ||--o{ ADDRESS : saves
CUSTOMER ||--o{ ORDER : places
RESTAURANT ||--o{ ORDER : receives
ORDER ||--|{ ORDER_ITEM : contains
MENU_ITEM ||--o{ ORDER_ITEM : "ordered as"
RIDER ||--o{ ORDER : delivers
MENU_ITEM {
int id PK
int category_id FK
string name
decimal price
bool veg
}
ORDER {
int id PK
int customer_id FK
int restaurant_id FK
int rider_id FK
string status
decimal total
}
ORDER_ITEM {
int id PK
int order_id FK
int item_id FK
int quantity
decimal unit_price
}A Swiggy/Zomato-style food delivery platform: customer, restaurant and rider apps, and the services that match orders, riders and payments.
Everything that happens between a customer tapping Place Order and the food arriving: payment, restaurant acceptance, rider assignment, pickup and delivery.
Every status of a food delivery order, from placed to delivered, including restaurant rejection, no rider and customer cancellation.
How orders from dine-in, takeaway and delivery apps flow through a restaurant kitchen display system to the pass and out.
How a food delivery platform scales for lunch and dinner peaks: pre-scaling, autoscaling services, sharded databases and a surge-protected dispatch.
A cloud kitchen that runs several virtual brands: orders from aggregators, a kitchen display system, inventory and dispatch.