Glossary
Exclusion Constraint
Definition
A database-level mechanism (PostgreSQL btree_gist) that makes overlapping bookings for the same resource physically impossible. Unlike application-level checks, exclusion constraints cannot be bypassed by race conditions or concurrent requests.
Why It Matters
Application-level double-booking checks fail when two dispatchers book the same aircraft at the same time — both checks pass, both inserts succeed. Exclusion constraints enforce the rule at the database layer, guaranteeing no overlaps regardless of timing.