3 ms·
> specially with a massive number of concurrent users I think that's where you're wrong... first of all, the number of hotel booking transactions is nowhere ne
by crazygringo 3y ago
> specially with a massive number of concurrent users
I think that's where you're wrong... first of all, the number of hotel booking transactions is nowhere near the number of interactions on a social media site/app, for example. It's not massive at all -- it's something any modern database server can handle easily, with replication for reads as required.
And secondly, even if it were massive, it's not massive per-property which is the only thing that matters in terms of transactions here. Database sharding in this case is incredibly straightforward, compared to many other types of websites. And in both cases, just use standard database transactions.
Now, in reality, as other commenters have attested, it's actually an optimistic communications process with each property that has nothing to do with databases at all, and overbooking can absolutely happen when both Booking.hom and Hotels.com book the same last room before the hotel has confirmed one or the other. And then it gets sorted out manually, by the hotel, because the hotel is aware of it.
- trilobyte 3y ago> "And secondly, even if it were massive, it's not massive per-property which is the only thing that matters in terms of transactions here. Database sharding in this case is incredibly straightforward, compared to many other types of websites. And in both cases, just use standard database transactions." This is such an important point that a lot of software devs don't get. If you think about the shape of the data, you can often find ways to naturally partition the data so that you are dealing with much smaller scale.
- hedora 3y agoNot only is it an optimistic communications process, but the charging of your credit card isn’t even atomic. I once showed up to a hotel hours after my card had been charged successfully. The backend credit card of the reservation company declined the charge, so the hotel room had been booked, but the hotel hadn’t been paid. The hotel manager sat on hold for 10 minutes, and the website fixed it.