[System Design : HLD/LLD] How to prevent two people from booking the same seat in a flight?

Give a flight ticket booking system, how to prevent two people from booking the same seat? What would be the system design fore this?

I thought putting some unique constraint on a database table should do the trick but that was not enoguh.

Would database not be able to handle concurrent bookings and fail one os them if its for the same seat?

What if the transaction fails? Or Payment fails?

Comments (0)