ECHO & AURA · DEVELOPER DOCUMENTATION
A real system.
The reasoning behind it.
Understand how a ticket reservation, a manual payment, and a background job fit together. Follow the explanations into the code and tests.
Choose a path
- Guided toursBuy a ticketFollow one order from registration through manual payment, approval and email delivery.
- ConceptsWho gets the last ticket?See why one conditional UPDATE admits one buyer and refuses the other.
- ReferenceOrder statesThe status contract: who owns the inventory at each step, and what ends an order.
Try it: two buyers, one ticket
Step through the race the reservation query settles. The full concept shows the real query and the Postgres test behind it.
ILLUSTRATIVE WALKTHROUGH · STEP 1 OF 4
First request to update:
One ticket remains
- Available
- 1
- Reserved
- 0
- Row lock
- Unlocked
Buyer AReady
Buyer BReady
Both buyers request one ticket. The page may show one available ticket to both; neither request has reserved it yet.
Counters show committed database state.
One possible ordering at Read Committed isolation, with both transactions otherwise succeeding. This model does not run SQL. The linked Postgres test checks the implementation.