Skip to main content

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 UNIQUE and stripe_payment_intent_id UNIQUE.
  • Holds expire: holds.expires_at indexed; background sweeper releases expired holds.