Define exactly what consumes capacity

Imagine a Budapest sewing workshop with six interchangeable workstations per fixed session, one per attendee. Four are booked. Two customers each see two free places and each request a pair. Confirming both promises eight places. More frequent page refreshes cannot prevent this conflict.

Specify one capacity pool for each session, shared by the website, app and staff bookings. Count participants, not booking records. Agree whether a group request must succeed in full; never silently turn two requested places into one. Staff adjustments must follow the same capacity rules.

Secure places when the request is accepted

Ask for a protected server operation that checks current capacity and records the reservation together. Checking first and saving later allows another customer to claim the same places. Confirm only an accepted booking, with its session, quantity and reference.

Firestore documents transactions whose writes succeed together or do not apply. This can support a capacity rule, but the developer must implement that rule. If insufficient places remain, explain the result and offer a fresh choice. Do not silently switch the customer to another session.

Choose whether temporary holds are worthwhile

Immediate booking at the final step is simpler, but places may disappear while customers complete the form. A temporary hold protects their selection during that process, while making those places unavailable to others. Choose its duration deliberately and show both the held quantity and when the hold ends.

Use the server’s deadline to decide whether a hold is valid; the displayed countdown is only guidance. Firestore’s TTL documentation warns that expired records are not deleted immediately. Therefore, booking rules must stop expired holds consuming capacity independently of cleanup. A successful confirmation converts the active hold into a booking without counting the places twice.

Make every capacity change follow the same rules

Confirmation must check that the hold belongs to the request and is still active within the protected operation. If it expired, explain that the places are no longer held and check availability again before asking for a new confirmation. Closing a tab should not be the only way abandoned holds are released.

A lost reply can leave a successful booking looking unfinished. Give each logical booking request a stable reference so a retry can recover its result instead of reserving again. Coordinate cancellation and hold expiry so places are released once. Distinguish an uncertain result from a rejection, and give staff a way to investigate.

Test the last places before launch

Use test sessions and inspect the saved bookings and remaining capacity after each case. Ask the team to demonstrate these checks across both customer and staff interfaces.

  • Submit two competing requests for the last places; confirm only what capacity permits.
  • Request a pair when only one place remains; preserve the agreed group rule.
  • Let a hold expire while its record still exists; verify the places become available.
  • Confirm near the expiry deadline; check that confirmation and release cannot both win.
  • Lose the reply and retry the same request; verify one booking and one capacity deduction.
  • Repeat a cancellation and increase a group size; verify release happens once and increases require capacity.

Sources and further reading

← Back to Insights