Skip to main content

Posts

Showing posts from October 27, 2021

Case Study - How to handle concurrent reservation

Greetings! There are multiple domains with reservation build into it, however the problem they face is same. How do you handle when concurrent users try to reserve the same resource? We can see this situation in systems like; Doctor appointment Airline ticketing Movie ticketing Hotel booking Train ticket many more... Depending on how you define the business this again has two paths. Reserve the same resource - exact time slot for a doctor appointment. Reserve with count - 10 patients for a doctor for given timeslot with an appointment number. Let's understand the problem again You are going to watch the latest hit movie. While you are on your way, someone faster than you passed you. Then both of you joined the queue. Unfortunately for you, the person before you got the last available ticket hence you missed the chance to watch the movie at that time. Now imagine there is a fraud happen. Somehow, someone has the same ticket as you have. Sure