What is Query Driven Modelling
You design your data schema starting from the exact queries you need to run — not from entities or relationships.
Traditional (Entity-driven) modelling
You start with Entities and Relationships and then you write queries
Query-driven modelling
You start with questions, not tables.
Get all orders for a customer in last 30 days”
“Get all orders for a restaurant today”
“Get delivery updates for an order”
Create one table per query
OrdersByCustomer(customer_id, order_time) → order_data
OrdersByRestaurant(restaurant_id, order_time) → order_data
DeliveryUpdatesByOrder(order_id, update_time) → status
When to use
Queries are known and stable
Reads must be very fast
Write amplification is acceptable - Same data written to multiple tables.
Scale > flexibility