Data Model & Invariants
This page documents the minimum data model required to enforce correctness (no oversell, no double fulfill, safe retries).
High-level entity model
Critical invariants (the “why”)
- Reserved seating uniqueness: enforce
UNIQUE(event_id, seat_id)for issued tickets (or a dedicated seat_assignments table). - Payment idempotency:
payments.order_id UNIQUEandstripe_payment_intent_id UNIQUE. - Holds expire:
holds.expires_atindexed; background sweeper releases expired holds.