Taking an example of hotel booking system, when a user click on reserve the system holds the room for few minutes, say 20mins, so that the user can fill information and do the payment during that time period. If the user is not able to complete the booking within 20 mins, the system releases the room for new bookings.
How is this timeout implemented and how do we display the timer to the user?
Do we save key-value pair in redis for the reservation with ttl set to 20 mins and then display it to the user in the UI somehow? And when the ttl expires, redis notifies the system which then releases the room? But what if the user is on a third party payments page(stripe/paypal) and redis ttl is reached. If the user makes the payment but we have already released the room by then?