3 ms·
I would have assumed that dividing bookings per day by seconds per day is meaningless. For a given hotel in a given time zone wouldn't it be quite spiky?
by iudqnolq 3y ago
I would have assumed that dividing bookings per day by seconds per day is meaningless. For a given hotel in a given time zone wouldn't it be quite spiky?
- hedora 3y agoYes, but even if you have a 10,000 room hotel, and everyone books in the same second, a low-end RDBMS server will yawn at the spike.
- iudqnolq 3y agoAs a novice I'm interested in how people reason through this sort of question. I was surprised the person I replied to used the reasoning they used, and that's what I was asking about. If we put the entire 100M/day traffic evenly distributed in a single hour we're in the order of 10k qps. Isn't that the same order of magnitude as the absolute max writes you can buy from AWS RDS Postgres for a single-primary setup without sharding? That seems to me to be a worryingly close hard limit that suggests you'd want to start working on something a little more complex
- rgoulter 3y agoThe key point is more "an average computer & just sqlite can handle a lot of traffic", and not "if you're handling a lot of traffic, sqlite is probably fine". Whereas, if you don't have much traffic, you're probably better off going with a simple solution (sqlite on an average computer) than prioritising scalability.
- iudqnolq 3y agoRight, and I'm trying to figure out an intuition for what a lot of traffic is. My current intuition said 100M bookings per day has a decent chance of being a lot for sqlite and even postgres depending on how it's distributed, so you'd want to get more specific in your reasoning
- rgoulter 3y ago> My current intuition said 100M bookings per day has a decent chance of being a lot for sqlite and even postgres depending on how it's distributed If you don't know the distribution of requests, assuming a constant rate simplifies calculations; and can be interpreted as "what if the traffic gets as high as this". sqlite can handle 50k inserts per second. -- Sure, if you need more than 50k inserts in a second, then you can't use sqlite. But, the rate of 50k/second sustained for a day would be half the world's population booking a hotel every day. (Since "seconds in a day" is much smaller than "half the world's population": that the rate for one day is staggeringly high indicates that that rate for one second is also staggeringly high).