This content has been marked as final. Show 1 reply
The server doesn't know what a booking is - how could it do anything for you? Your problem is also not about code synchronization - it is perfectly valid for two people to process a booking at the same time, it is only not valid to process the exact same booking at the same time.
Me - I'd pretend that there is no such thing as two people booking the same slot at the same time - until the very last moment where you actually commit the booking to a particular person. One of them is going to be first and that's the winner, in the other's case before saving you'd check the database if it is already taken and then inform the user that he/she's out of luck. The stupid and easy solution that is also quite safe.