Designing Real-Time Availability and OCC in Distributed Scheduling
An in-depth look at our backend architecture: Optimistic Concurrency Control (OCC), reactive subscriptions, and preventing double-booking race conditions.
Devin Labadini
June 30, 2026 • 1 min read
Booking platforms face a classic concurrency problem: when two clients (or AI agents) attempt to book the same 2:00 PM appointment slot at the exact same millisecond, how do you prevent double-booking without introducing crippling table locks?
The Architecture
Vamos is built on top of a reactive serverless document store with built-in Optimistic Concurrency Control (OCC).
1. Atomic Timeslot Reservations
When a booking mutation begins:
- The transaction reads the target timeslot's current state and version hash.
- Validates that no overlapping appointment exists for the requested staff member or room.
- Computes the booking duration, buffer, and deposit requirements.
- Writes the new booking record and transitions the timeslot state to
reserved.
If a concurrent mutation writes to the same record during calculation, OCC automatically aborts and retries the transaction.
2. Zero-Poll UI Subscriptions
Because queries are reactive subscriptions, when a slot is booked, every active browser viewing the business's schedule receives an instant websocket delta.