Preventing Double Bookings: Why One Check Is Not Enough

Why double bookings happen and how to prevent them: concurrency, time zones, buffers and database-level guarantees.

Two customers at the door for the same slot. There are two records in the calendar and both are valid. This is usually explained as “the system does not check” — yet in most setups the check exists; it simply happens at the wrong moment.

How clashes happen

  1. Concurrent booking: two people take the same slot within the same seconds. Both checks say “free”, because neither booking is saved yet. This is the most common and most insidious cause.
  2. Duration arithmetic: the end time is ignored. With 14:00–15:00 booked, 14:30 still looks free.
  3. Time zones: the server runs in UTC and the user in local time, so appointments near midnight land on the wrong day.
  4. Daylight saving and day boundaries: if “today’s appointments” uses the wrong range, clashes become invisible.
  5. Separate channels: if the online page, the phone and the team screen write to different places, clashes are guaranteed.

Where the check has to live

A check in the interface is for user experience; it is not a guarantee. In the milliseconds between checking and saving, somebody else can take the slot. Real protection belongs at the bottom, where the data is written.

The layered approach works like this:

1. Interface

Busy times are simply not offered. The user makes a valid choice without hitting an error — a convenience, not a guarantee.

2. Application

A server-side clash check at save time. The same check must live in one place for every channel — the online page, the team screen and the API all using one rule.

3. Database

The last line of defence. A constraint preventing overlapping time ranges for the same person will not accept two concurrent bookings; one of them fails.

Without the third layer, clashes will eventually happen at busy times. With it, the data stays consistent even if a gap remains in the application code.

Do not forget buffers

Back-to-back appointments accumulate delay. A buffer on top of the service duration (preparation, cleaning, travel) produces a realistic calendar and stops delay cascading. The buffer must be part of the clash calculation; otherwise the calendar looks free while in practice it is full.

Settle the time zone once

How appointment times are stored on the server and which time they are displayed in — until those two are settled, clash problems cannot be fixed. The rule is simple: store in one form, display in local time. Day-based queries such as “today’s appointments” must use local day boundaries, not the server’s day.

When a clash does happen

  • Telling the user “save failed” is not enough; show which appointment it clashes with.
  • Suggest the nearest available times.
  • Where a deliberate clash is needed (an emergency, a second resource), provide a permission-gated exception — a recorded exception rather than a hard block.
  • Exceptions should be reportable; a calendar that clashes constantly is signalling a capacity problem.

Frequently asked questions

We can see two customers at once, so clashes are fine.

Then your resource is capacity rather than a person. The system should let you define how many appointments fit a slot, and check against capacity rather than per person.

How does it work for group appointments?

A group slot has capacity greater than one, so the check asks “is the quota full?” rather than “is it busy?”. Both models need to be definable separately in the same system.

What happens to existing appointments when someone goes on leave?

They should not be cancelled automatically. The right behaviour is to list the affected appointments and offer to move or reassign them.

Next step: to see how clash checking behaves in your own flow, request a demo.