Estimates and calculations
Let’s start by asking and answering some questions:
- How many users do we have? 100M
- How many Daily Active Users (DAU) do we have? 10% of total users, making 10M/day.
- Queries per second to support for daily active users: People usually order food around lunch and dinner time, so let’s assume that orders will be placed for 3 hours during lunch and 3 hours at dinner time. 10M DAU placing orders within 6 hours means that
QPS = 10M/6*60*24 ~=
1200 QPS
. - What about traffic spikes? I think 5x is a good assumption:
5 * 1200 ~
60000 QPS.
- How many people are browsing restaurants and doing searches? Assuming 10M users doing 5 search queries, then search
QPS = ordering QPS *5 =
60000 QPS
. - How many restaurants are on the app? Let’s assume 10M restaurants in the world and also let’s assume 1M restaurants are online on our app. Restaurant data doesn’t change often.
OK, now we have the high-level estimates...