Designing a reservation system schema

database-design

I am not sure if this has been asked before, however I am tasked with designing a new reservation system for my organization

We have an older system which simply stored the booking in a table, and it worked pretty well, but it becomes quite slow when I try to determine what time slots are free (It has to get the open/close time range, and calculate whats free by taking away whats booked). Ideally, I would like a better solution for this, and I am hoping that somebody has solved the problem before.

The booking system itself will display only one day at a time, listing whats booked & whats available for that specific day.

Best Answer

As Joel says, you would be better off storing bookings rather than availability. This will make any future changes to operating hours or booking conditions easier (slot length, minimum/maximum booking duration etc). Also, you won't have to pre-populate an availability table out to some arbitrary future date.