Skip to content
Astera Technology

Confirm one booking when two requests compete

Make the availability check and reservation one controlled decision, then handle the losing request explicitly.

Trace both requests at the write boundary

A displayed free slot is an observation, not a reservation. HTTP conditional writes can reject stale state when supported, but the booking service must enforce its conflict rule atomically. This sample assumes one room, one slot and a versioned reservation contract.

Synthetic competing reservation trace
RequestRead stateCommit result
CMD-ASlot free, revision 5Confirms BK-A; revision becomes 6
CMD-BSame slot/revision 5Refused as stale or conflicting
Retry CMD-AResponse was lostReturns/reconciles BK-A, no second booking
Download editable CSV ↓

Keep rejection distinct from pending

After losing the race, refresh availability and offer alternatives without marking the customer confirmed. A changed slot selection is a new authorised intent. Test simultaneous writes, stale revision and a lost success response; a single-user demonstration misses the race.

Both clients checked availability before either wrote. Can both be confirmed?

Show the worked answer

No under this one-slot contract. The controlled write must choose at most one confirmed reservation. The loser receives a clear conflict/stale outcome and must choose again.

Related resources

Membership and booking systems →