Case study 05 / Scheduling

Room booking, where the whole point is that nobody thinks about it.

A booking workflow for shared spaces — visible availability, no double bookings, and a reservation that takes seconds instead of a message to whoever keeps the calendar.

Role
Sole developer — scheduling model, conflict handling, interface
Stack
Web application · Relational database · JavaScript
Type
Resource scheduling / reservations

The problem

Shared rooms are managed informally until the day they cannot be. A wall calendar works for one room and five people. Add a second room, a few recurring meetings, and someone who books over lunch, and the failure arrives as two groups standing in the same doorway.

The informal system does not fail loudly enough to get fixed. It fails occasionally, wastes fifteen minutes, and everyone goes back to the wall calendar.

What the system does

How it is built

The interesting engineering in a booking system is entirely in one place: making sure two people cannot reserve the same slot.

Conflicts are prevented by the database, not the interface

Checking for a conflict and then writing the booking leaves a gap between the two — small, but real, and it is exactly the gap two people clicking at the same moment fall into. The overlap check is enforced at the database level so the guarantee does not depend on timing. The interface still checks, because a friendly warning is better than an error, but correctness does not rely on it.

Time is stored properly

Bookings store an explicit start and end rather than a date and a duration in a separate field. It makes overlap queries straightforward and avoids the class of bug where a booking crossing midnight quietly behaves differently from one that does not.

Reusable pattern. Any "only one of these at a time" rule — a seat, a slot, a licence, a delivery window — belongs in the database constraint, not the application logic. Application-level checks are a user experience improvement layered on top of a guarantee, never the guarantee itself.

What I would change

Recurring bookings are the feature every organisation asks for second, and they are considerably harder than they look — a weekly meeting that skips a public holiday, or moves once, turns one record into a series with exceptions. Designing for that from the start is much cheaper than adding it to a model built around single bookings.

Need something similar?

Scheduling comes up for rooms, equipment, vehicles, staff shifts, and appointments — the same underlying problem each time. The business systems service covers this kind of build.

Still booking rooms by message?

Scheduling problems are small until they are not. If yours has started costing time, it is worth an hour's conversation.

Start a conversation ↗