Websites · Glossary

What is a double booking, and how do systems prevent it?

A double booking is when two bookings are accepted for the same time slot with the same person, room or resource, so one customer arrives to find their appointment already taken. Online it usually happens when two requests arrive almost together, or the slot list is out of date. Reliable systems prevent it in the database, which refuses any booking that overlaps another.

A double booking is rarely a person's mistake. More often two requests arrived at the same moment and both saw a free slot, and only the database is in a position to decide which one wins.

· Co-founder

5 min read · Published

Common causes of double bookings and the fix for each
CauseWhat happensFix
Simultaneous requestsBoth see the slot free and both saveA lock or exclusion constraint in the database
Stale slot listA page open for an hour offers taken slotsRecheck on save and refresh the list
Start time only checkA 10:30 booking overlaps a 10:00 oneCompare time ranges, not start times
Staff on leaveA booking lands on a day offTime off rows checked in the same rule
Several channelsPhone, walk in and web lists disagreeOne booking list every channel writes to
Editable bookingsA customer moves their own booking anywhereChanges only through a checking function

What a double booking is

A booking reserves a resource for a period: a stylist from 10:00 to 10:45, a treatment room from 2 pm to 3 pm, a hire trailer for Saturday. A double booking is any second booking for the same resource whose period overlaps the first. It does not need the same start time; a 10:30 booking overlaps a 10:00 booking that runs 45 minutes. The cost is more than one unhappy customer. Someone has taken time off work or driven across town, staff have to choose who to turn away, and the review that follows is usually about the business, not the software. Deliberate overbooking, where airlines or some clinics accept more bookings than places because a share never show up, is a separate business decision. This page is about the accidental kind, which a booking system should make impossible rather than merely unlikely.

How a database refuses overlaps

Checking for free slots on the booking page is necessary but not enough. Two people can load the page at 9:00:00, both see 10:00 free, and both press Book a second apart. If the server checks "is anything booked at 10:00?" and then saves, both checks can pass before either save lands. There are two reliable fixes, and both live in the database. The first is a lock: the booking function locks the stylist's record, checks for overlaps, saves, then releases, so the second request waits and then sees the first booking. The second is a constraint the database enforces on every save. In PostgreSQL an exclusion constraint can say that no two active bookings for the same stylist may have overlapping time ranges, using a range type for the start and end and the btree_gist extension to combine the stylist and the range. Whatever the screens do, the second overlapping booking is refused.

When it matters most

The risk grows with demand and with the number of ways in. A popular stylist whose Saturday slots open at 8 pm on Sunday will see simultaneous requests. A business taking bookings online, by phone and in person into different places is almost guaranteed to double book, because each channel only knows about its own list. Shared resources raise the stakes: two practitioners sharing one treatment room can each be free while the room is not, so the overlap rule must cover the room as well as the person. Classes and tables with capacity are a variation: the rule is not "no overlap" but "no more than twelve people", which needs a count inside the same lock. Time off and buffers matter too; a booking system that does not know a staff member is on leave, or that a colour needs fifteen minutes of clean up, produces bookings that clash in practice even though none overlap on paper.

Common mistakes

Relying on the page to hide taken slots and assuming that prevents clashes. Checking for an existing booking at exactly the same start time instead of any overlap. Letting customers edit their own booking row directly, so a person can change the time to one that was never offered; changes should go through a function that checks the new time. Counting cancelled bookings as taken, which hides free slots, or forgetting them in the overlap rule, which lets a cancelled slot be rebooked twice. Ignoring time zones, so a booking stored in UTC appears an hour off during daylight saving. Taking phone bookings into a paper diary while the website takes its own. And using a shared calendar as the source of truth, which shows overlaps clearly but usually does nothing to refuse them.

Where it shows up in OneCraft

When a site is generated with bookings, the AI builds them into the site's own database from its bookings guide, and the guide's first rule is that double bookings are refused in the database. Bookings are made through a function that locks the staff member's record, checks the opening rules and any overlap, then saves; for simple cases the AI can add an exclusion constraint on the booking's time range per staff member, ignoring cancelled bookings. Visitors cannot insert or edit bookings directly. A signed in customer sees their own bookings and can cancel one only while it is in the future, and the AI checks those rules as an anonymous visitor and as a signed in person. New bookings start as requested, and the owner confirms them; there is no live calendar feed to an outside calendar.

Questions people ask

How should I handle a double booking that already happened?

Contact the person booked second as soon as you notice, apologise, and offer the nearest alternatives or a small goodwill gesture. Then find out how it happened: two channels, a manual entry, or the system itself. A double booking caught a day ahead is a minor apology; one discovered at the door costs a customer.

Do buffer times between appointments prevent double bookings?

They prevent a different problem: appointments that do not overlap on paper but clash in practice because of clean up, travel or notes. Build the buffer into each service's length or into the overlap rule. They do not stop two requests for the same slot; only a database lock or constraint does that.

Does a shared online calendar stop double bookings?

Not on its own. A shared calendar shows everyone the bookings, which helps people avoid clashes, but most calendars will happily accept two events at the same time. To refuse an overlap, bookings must go through a system that checks for it when saving.

How do classes with limited places avoid overbooking?

The rule changes from no overlap to no more than the capacity. The booking function locks the class, counts the confirmed places plus the new party size, and refuses the booking if it would exceed the limit. A waitlist then catches people who were too late and offers them a place if someone cancels.

Should customers be able to reschedule their own bookings?

It saves staff time, and most customers prefer it, but the reschedule must go through the same checks as a new booking, including overlaps, opening hours and staff leave. Set a cut off, such as 24 hours before, so late changes come to staff, who can judge whether the slot can still be filled.

Make one with websites

The button opens the generator with this use case already described. Change the wording to match your own.

Create a website with OneCraft

Related questions

Sources

Written and checked by the OneCraft team. Last checked .