Skip to main content

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.

DL

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:

  1. The transaction reads the target timeslot's current state and version hash.
  2. Validates that no overlapping appointment exists for the requested staff member or room.
  3. Computes the booking duration, buffer, and deposit requirements.
  4. 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.