Two customers open your booking page at the same moment. Both see 3:00 p.m. on Thursday as free. Both click Book within a second of each other. What should happen is simple: one gets the slot, the other is offered the next time. What often happens in poorly built systems is that both bookings succeed, and you discover the clash when two people turn up. This is called a race condition, and it is one of the most common defects in online booking. It is also invisible in testing, because a single tester never clicks at the same instant as another. This guide explains why double bookings happen, the techniques that prevent them, how a chat assistant fits in, what to ask a vendor and how to test your own system. It starts in plain language and goes as deep as a technically curious owner or developer would want.
Why double bookings happen
Booking has three steps: show the free times, let the customer choose one, and save the booking. Between showing a time and saving it, the world can change. Another customer may have taken it. A naive system checks availability when it displays the times and never checks again.
| Moment | System A (naive) | System B (careful) |
|---|---|---|
| Customer 1 sees 3:00 free | Free | Free |
| Customer 2 sees 3:00 free | Free | Free |
| Customer 1 clicks Book | Saves the booking | Checks again, locks the slot, saves |
| Customer 2 clicks Book a moment later | Saves a second booking for 3:00 | Checks again, finds it taken, offers the next time |
| Result | Double booking | One booking, one polite alternative |
The difference is the second check, made at the moment of saving and made safe against simultaneous requests.
The techniques
1. Check again at confirmation
Never trust the availability shown earlier. Before saving, look at the current bookings for that slot. This alone removes most double bookings, but not all: two requests can both pass the check in the same instant, before either has saved.
2. Lock the slot while saving
A lock makes the check-and-save step indivisible. The first request takes the lock for that slot, checks, saves and releases. The second request has to wait, then checks again and finds the slot taken. On one server this can be an in-memory lock. On several servers, which is normal in cloud hosting, the lock must be shared, for example through the database or a shared cache, otherwise each server believes it holds the only lock.
3. Let the database enforce it
The strongest protection is a rule in the database itself that two bookings cannot share the same slot, such as a unique constraint on the combination of resource and start time. Even if application code has a bug, the database rejects the second booking. The application then catches the rejection and offers the next time. This is the safety net for every other technique.
4. Hold a slot briefly during checkout
If booking involves several steps, such as entering details or paying, systems sometimes hold the slot for a few minutes so nobody else can take it while the customer types. The hold expires if the booking is not completed.
5. Handle failure kindly
When a customer loses the race, the experience matters. 'That time was just taken. Here are the next available times' is far better than an error message. In a chat, the assistant can say it in one friendly line and show alternatives.
Layers, not a single trick
| Layer | What it does | What it catches |
|---|---|---|
| Check at confirmation | Rejects slots already taken | Most clashes |
| Shared lock | Serialises simultaneous requests | Near-simultaneous clicks |
| Database constraint | Refuses duplicates at the source | Bugs and unusual timing |
| Graceful retry | Offers the next time | Keeps the customer |
A trustworthy booking system has at least the first three. Crescelo's built-in booking hides slots that are already taken and locks a slot while it is being booked, so two visitors cannot get the same time, and a visitor who loses the race is offered the next one.
Where the AI fits in
An AI assistant should never decide availability itself. A language model can misread or invent times. The safe design is that the assistant handles the conversation and the booking engine handles the calendar: the assistant asks the engine for free slots, presents them, and asks the engine to book the chosen one. If the engine says the slot is gone, the assistant relays that and offers more. This separation is what makes chat booking reliable. See AI appointment booking and stop double bookings online for the practical view.
Other ways double bookings sneak in
- Two systems, one calendar. Bookings made in a booking tool and by phone into a separate diary clash unless both use the same source of truth.
- Personal events not blocking slots. A read-only calendar feed shows bookings in your calendar but does not block slots when you add events there; adjust booking hours to match your real availability. See AI bookings in Google and Outlook Calendar.
- Time zone and daylight saving errors. A booking stored in the wrong zone can overlap another.
- Resource confusion. Two staff or rooms treated as one, or one treated as two.
- Manual changes. Staff overriding the system without updating it.
How to test your own system
- Open the booking page in two browser windows, or on two devices.
- Select the same slot in both without booking.
- Click Book in one, then immediately in the other.
- Check that only one booking exists, and that the second window shows a helpful message.
- Repeat with two people clicking at the same instant, if you can arrange it.
- Test through the chat as well as the booking page.
- Try booking a slot that a phone booking has just taken.
If both succeed, the system has a race condition. Report it to your vendor with these steps, or fix it with the layers above. A developer can also write an automated test that fires many simultaneous requests at the same slot and checks that exactly one succeeds.
What to ask a vendor
- How do you prevent two bookings for the same slot?
- Is there a database rule as well as application checks?
- What happens if two servers process requests at once?
- How does the customer who loses the race experience it?
- Can you show a test or a description of your concurrency handling?
A confident answer names the layers. A vague 'we handle that' deserves a test.
Recovery: when a double booking happens anyway
- Contact both customers promptly and apologise.
- Offer the customer who booked second the earliest alternative, and consider a small gesture.
- Find the cause so it does not repeat.
- Record the incident and what you changed.
Treat it as a defect to fix, not bad luck. The cost of two disappointed customers is larger than the cost of a fix.
Frequently asked questions
How do booking systems avoid double bookings?
By checking availability again when the customer confirms, locking the slot while it is saved and using a database rule that forbids two bookings in the same slot.
What is a race condition in booking?
A defect where two simultaneous requests both see a slot as free and both succeed. It is fixed with locks and database constraints.
Can an AI chatbot cause double bookings?
Not if it only relays the booking engine's results. It becomes risky only if the model decides availability itself.
Does Crescelo prevent double bookings?
Its built-in booking hides taken slots and locks a slot while it is being booked, so two visitors cannot get the same time.
How do I test for double booking?
Open the booking page twice, select the same slot in both and confirm in quick succession. Only one should succeed.
What if I take bookings by phone as well?
Enter phone bookings into the same system, or reduce booking hours so slots are not offered twice.
See how booking works in Crescelo, try a booking flow in the playground and read AI appointment booking.
Further reading
- Google Calendar API overview: How calendar events are read and written by software.
- Google Search Central: creating helpful, people-first content: What Google looks for in useful pages.
VASTAA JOKAISELLE KÄVIJÄLLE. VARAA AIKA NIILLE, JOTKA OVAT VALMIITA.
Ota Crescelo käyttöön verkkosivustollasi 15 minuutissa
Opeta avustajasi hinnastoillasi, asiakirjoillasi ja palveluehdoillasi. Ota käyttöön lähteisiin perustuvat vastaukset ympäri vuorokauden ja päällekkäisyydettömät ajanvaraukset suoraan chatissa.