Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Online Hotel Booking System, Simultaneous Booking?

I'm asked to create an online booking system with online payment and I'm wondering what to do in the case when 2 customers booked for the same room(s) at the same time.

For Example:
At the same time:

Customer1 and Customer2 booked for a standard room which only has 1 room available. (The Room availability will display that there is still 1 room available). And then they hit the 'confirm' button at the same time.

like image 495
KiiroSora09 Avatar asked Nov 25 '11 01:11

KiiroSora09


People also ask

How do you handle concurrency in ticket booking system?

How to handle concurrency such that no two users are able to book same seat? Utilize transaction isolation levels. SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; for the seat and booking update. As Serializable level guarantees safety from Dirty, Nonrepeatable and Phantoms reads.

What is the implication of online hotel booking system?

Unlike traditional hotel booking through travel agents, online hotel booking offers benefits to consumers such as accessing more photos and videos, a full description of the hotel property and location, better pricing, and no additional booking fees (O'Connor and Frew, 2004, Sparks and Browning, 2011).

What is centralized reservation system?

The meaning or definition of a CRS or Central Reservation System is a type of reservation software that is used to update and maintain information of a hotel pertaining to inventory and rates so that hotels are able to manage guest reservations and the process around such reservations in real time.

What reservation system do hotels use?

A central reservation system (CRS) is a platform used by hotels to centrally manage and distribute room inventory, rates, and reservations. The CRS extracts rates from your PMS (property management system) and then writes back reservations into the PMS when booked across a variety of channels like GDS and IBE.


1 Answers

Use a locking construct (probably on the database level in this case) to ensure that only one confirmation will go through at once. You should always do this if it's possible to have a race condition like this. That way you will always know who was first, and you can tell the other user that they were too slow to confirm.

Another thing you might want to add is a payment time limit. In many systems, when you confirm something, you will have a certain amount of time to make a payment to get the reservation. If you don't pay within that time, the confirmation will expire and the room will once again be available.

like image 157
Matti Virkkunen Avatar answered Sep 23 '22 18:09

Matti Virkkunen