Quick answer
Concurrency control in custom software decides which simultaneous changes may commit. Route every writing channel through the same authority: protect appointments against overlap, spend credits only when enough remain, and reject stale edits using version checks. Commit related local changes together. Track repeated requests separately, and keep uncertain external payments pending rather than promising a booking.
Make the commitment: concurrency control in custom software
The booking page and chat assistant can both correctly display the same free appointment. The decision comes when customers try to claim it. If several channels can change the same resource, give them one authoritative server-side write path that checks eligibility while making the commitment.
An availability check describes what the system could see at that moment. It does not reserve anything. A chat request can read “free,” then a website request can read “free,” before either writes a booking. Each channel has followed its own instructions; together they have promised the same coach twice. Disabling a button helps prevent accidental clicks on that screen, but cannot settle competition from another screen.
Concurrency control decides which competing changes become committed facts. State the rules plainly: no overlapping coach appointments, no negative credit, no silent replacement of newer edits. Selection, a committed hold and a confirmed appointment are different promises. Report success only after the protected operation commits.

Match the shared resource to its control
Choose a control by the rule it must preserve. Appointments need protected allocation, credits need an indivisible balance change, and human edits need a check against the version originally opened. A workflow can require all of these; choosing one mechanism for the entire application leaves gaps.
| Shared resource or commitment | Authoritative record | Protected operation | Version, operation identity or expiry rule | Customer or operator conflict response |
|---|---|---|---|---|
| Capacity-one coach or room | Scheduling database’s blocking reservations | Insert an allocation that cannot overlap an active interval for the same resource | Confirm only the current owned hold before its deadline; release only a still-held reservation | Time unavailable; show current alternatives. Confirm only after commit. |
| Customer credit | Account balance and debit history in the same database | Decrease only when sufficient credit remains; commit debit, booking and result together | Unique logical operation identity; reject reuse with different purchase details | Insufficient credit creates no booking; replay returns the existing confirmation. |
| Operator edit | Current customer record and its version | Save only if the version originally loaded still matches | Advance the version on each protected edit | Keep the draft; show current values for explicit reconciliation. |
| External payment request | Provider payment outcome plus local payment–reservation relationship | Persist the relationship before the call; reuse the supported provider key for the same request | Durable local operation identity; unknown payment remains pending | Checking payment and booking status; do not invite another purchase. |
| CRM or chat booking copy | Committed booking at the scheduling authority | Publish committed state; send allocation requests back to the authority | Proposed booking-version check rejects older updates; assign field ownership | Delayed copies cannot create or cancel another appointment. |
For an application-owned resource with capacity one, PostgreSQL supports timestamp-range exclusion constraints scoped to that resource. Unlike uniqueness on a start time, these catch overlapping intervals with different starts. The documented route combines resource equality and range overlap using btree_gist. Protect blocking holds and confirmed appointments; release allocations through a guarded state change.
Assume an illustrative interval policy: a coach is booked from 10:00 to 10:30, start included, end excluded, with no buffer. A 10:15–10:45 appointment for that coach conflicts; another coach can work then, and the original coach can start at 10:30. Include required buffers in the protected interval. Use an explicit business timezone across channels.
For a single account, make spending conditional on sufficient credit within the database update. Checking first and subtracting later recreates the availability mistake. If credit and booking share a transactional database, commit the debit, confirmation and saved operation result together. This atomic operation either commits all related changes or none.
Human edits need a different bargain. An optimistic version check lets someone work without locking the record throughout their thinking time, then rejects a save if the record changed. Suppose two operators open the same customer details. One changes the phone number. The other submits instructions from the old form. Reject that stale save, preserve its draft and show original, proposed and current values. After reviewing the new phone number, the second operator reapplies only the instructions. Both intended changes survive.
EF Core with SQL Server supports version checks through a rowversion concurrency token. That is SQL Server-specific; PostgreSQL needs its own explicit version-check design. For CRM and chat copies, assign field ownership and reject stale booking versions. A CRM allocation button must still call the scheduling authority.
Change the choice when the rule changes. Interchangeable capacity greater than one needs an atomic capacity-allocation rule rather than a blanket overlap ban. Several immediate local changes may need coordinated locks held for a short transaction. Complex rules across independently changing records may justify Serializable transactions, whose committed results correspond to a serial execution. They still require retries and do not coordinate an external payment provider. If an external scheduler owns capacity, its accepted booking becomes authoritative.
Use api sdk workflow integration architecture to plan commands and committed outcomes between systems. A protected website is insufficient if calendar sync or staff tools allocate the same resource independently.

Follow one contested appointment through expiry and confirmation
A temporary hold must commit before the system promises the time. Confirmation must then check the current hold, its owner, state and deadline. A countdown reaching zero does not itself remove a blocking allocation; a guarded release must make that change.
In this illustrative scenario, Maya uses chat and Leo uses the website for the same coach’s 10:00–10:30 appointment that morning. Assume one PostgreSQL-backed scheduling and credit authority, capacity one, no buffer, start-inclusive/end-exclusive intervals and one explicit business timezone. The proposed policy gives five-minute holds; these are example assumptions, not provider defaults.
The owner’s initial separate availability checks can both say free. Instead, every allocation uses one protected path: briefly lock the resource’s coordination record, release eligible expired holds and attempt allocation, with overlap prevention as the database backstop. Commit before asking the customer to confirm; no database lock waits through a conversation.
Under these assumptions, Maya’s hold starts at 09:00 and expires at 09:05. Leo loses and receives current alternatives. Maya leaves. At 09:05:01, Leo tries again: the protected operation releases her still-held, expired reservation and creates his replacement until 09:10:01. Scheduled cleanup uses the same guarded release, which cannot clear a confirmed appointment or replacement hold.
Maya’s late confirmation spends no credit and is rejected. In this example Leo sees: “Your 10:00 appointment is held until 09:10:01. Confirm with 1 credit.” He has one credit and confirms at 09:05:30. A short transaction coordinates on the resource and hold, obtains current time after locking, checks identity, ownership, state and deadline, conditionally spends credit and confirms together. After commit: “Your 10:00 appointment is confirmed. Remaining credits: 0.” There is no external payment call.
Different purchases compete through the conditional debit: insufficient credit means no booking. Repeating Leo’s successful confirmation instead returns its stored operation result. Database uniqueness protects that identity; reuse with different purchase details is rejected. An idempotency key identifies repetition, not which customer wins a contested appointment.
After a lost response, recover the existing operation’s status and show its confirmation or pending result. Do not start another purchase to discover whether the first worked. Require separate demonstrations of allocation competition, last-credit competition and replay, including recovery after connection failure.

Prove the rule across channels before automatic confirmation
Commission a small demonstration through real writing channels before enabling automatic commitments. The proof is the committed outcome and the response each participant receives. Sequential clicks show that a workflow works in order; synchronized requests show whether it survives competition.
- The product owner states capacity, overlap, credit and expiry rules, plus the customer and operator responses when a request loses.
- The technical lead maps every writer, including chat, website, staff tools and integrations, and names the authority for each commitment. Close allocation bypasses.
- The developer implements protected writes, version checks and durable operation results, then connects the visible conflict and status-recovery paths.
- The integration owner adds external pending outcomes and guarded expiry. Assign a support owner for unresolved payment–reservation cases.
- The tester synchronizes competing requests through separate connections or application instances. The release owner reviews committed results before enabling automatic confirmation.
Demonstrate one allocation under slot competition, no overspending under distinct purchases, no extra debit on replay and preserved drafts after stale edits. Race expiry against confirmation: release cannot undo a confirmed appointment or replacement hold. Recover a dropped success response through status lookup. Repeat across chat, customer and admin routes; the workflow automation testing checklist extends adjacent coverage.
For complex PostgreSQL Serializable work, propose at most three whole-transaction attempts with fresh reads and no repeated external side effects. This is application policy. After exhaustion, return a retryable or pending result. Serializable can reject work and still raise errors; it does not make every request succeed. Keep transactions outside human input and payment calls.
Persist the payment–reservation relationship before calling the provider. Reuse Stripe’s supported idempotency key for the same request, retaining a durable local operation record because provider keys are not permanent. Show “Checking payment and booking status” while uncertain. Payment success must still pass the protected reservation check.
Stripe Checkout timed expiry must be between 30 minutes and 24 hours after creation. A proposed variant pairs a 30-minute application hold with the same permitted Checkout deadline, replacing the five-minute credit policy. Process expiry against the original reservation. For late success after release, show “Payment received; appointment needs resolution.” Preserve the newer booking and send original payment and reservation references to the named support owner. Refund or alternative-service execution belongs to compensation handling.
The automation to human handoff reading helps specify how support receives an exception. Stop automatic confirmation if writers lack a common authority, bypass the rule or produce conflicting commitments. Commission one resource contested through different channels, showing committed records and winner/loser responses together.

Connect confirmed bookings to the video experience
Once the appointment is confirmed, the next requirement is admitting the correct customer to the planned session. Keep the booking authority responsible for that eligibility decision. A call window on a page does not establish whether the visitor holds the confirmed appointment.
Carry the matrix into integration planning: which committed booking authorizes entry, which user may use it, and how a changed booking affects permission. Demonstrate that connection separately; successfully opening a room does not prove that conflicting bookings were prevented.
A simple embedded call window may meet the conversation requirement. Connecting scheduling, roles and booked-user access needs a closer integration assessment. Name both the video experience and concurrency acceptance criteria so neither disappears between development responsibilities.

Choose the video integration route with concrete requirements
Open Website Video Calling and compare its simple embed and API/SDK approaches against the need to connect confirmed bookings with session access. The guide also discusses custom development for scheduling and roles. Use the matrix to identify whether an embed meets the call requirement or a custom integration needs assessment. Keep concurrency safeguards as explicit acceptance criteria; the guide does not establish that they are already implemented.
Frequently asked questions
Does disabling the booking button prevent concurrent bookings?
It reduces repeated clicks on that screen. Requests from chat, other devices and staff tools still need the same protected server-side allocation rule.
Can a unique appointment start time prevent every overlap?
No. Appointments with different start times can overlap. For a capacity-one resource, protect the full occupied interval, including any required buffer.
Does an expired hold disappear automatically?
No. A deadline makes a hold eligible for guarded release. Confirmation and cleanup must check current state so neither acts on stale permission.
Is an idempotency key enough to stop double spending?
It identifies a repeated request. Different purchases competing for the same balance also need a conditional debit and coordinated booking commitment.
Should a payment timeout trigger another purchase?
Recover the existing operation’s status first. An unknown payment outcome must remain pending until resolved, rather than becoming permission to charge again.
What should staff see after a version conflict?
Keep the unsaved draft and show the current record alongside the proposed changes. Require review before saving against the refreshed version.
Must every change use Serializable transactions?
No. Select the smallest operation that preserves the rule. Complex multi-record rules may need Serializable isolation with bounded whole-transaction retries.
Does embedding video enforce booking eligibility?
Embedding provides a call experience. Booking eligibility and booked-user access are separate integration requirements that need their own demonstration.
Product designer at Scrile. Focused on user value and business outcomes. Writes about interface decisions, design-system economics, and where UX investment actually pays back.
