Im about to create a very simple online event reservation application and currently have 3 tables:
User
- PK_UserID
- UserName
Event
- PK_EventID
- EventName
- EventDescription
- EventStartDate
- EventEndDate
- SeatsAvailable
BookedEvents
- ID
- FK_UserID
- FK_EventID
Do you have any experience of how to handle SeatsAvailable? I mean if SeatsAvailable is set to 5 and there are 5 users online and want to book event. And some user has started to fill out the form then changed his mind. Then seats in database can just leak. I was thinking about sessions – like to limit every user to 5 minutes to complete the booking but i dont really know if its good idea. Do you have any suggestions?
I would use your way as well, but I would reset the timeout everytime the booking is progressed (ie. new page). I know from experience you sometimes have to look something up or similar, and I really hate pages timing out in that case. You should be fine with a timeout.