3

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.

4
  • 2
    need more business rules to go on. Sounds like you need better requirements. Would love to help but this is not much to go on.
    – B Woods
    Mar 27, 2014 at 17:57
  • It's still in the early stages of design, but it will be a self-serve booking system where a user will be able to log in, and book a slot for a limited period of time. It's still undecided if it will display when each item is booked, but it will definitely be displaying if said item is available for booking Mar 27, 2014 at 18:30
  • 3
    Unless your bookings are for very carefully regimented blocks of time (days, hours, half hours, etc.) you're really better off recording what is booked, not what's available. Do you have an efficient, set-based query for calculating what's available, such as one from the answers to this question: stackoverflow.com/questions/9604400/… ?
    – Joel Brown
    Mar 28, 2014 at 11:56
  • 1
    And what database are you using? You design your solution depending on features of the DB system. Jan 23, 2015 at 15:43

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.