Web Security · Business Logic
Unique constraint
A database rule that rejects duplicate non-null values for a column or specified column combination. UNIQUE (account_id, key) can protect a per-account business key even when two requests race. Application code must handle the resulting insert conflict.
Where you practice it
- Race and TOCTOU Foundations with Deterministic TestingWeb Security · Business Logic & Race ConditionsPractice this lesson →
- Idempotency and Duplicate Side EffectsWeb Security · Business Logic & Race ConditionsPractice this lesson →
- Cross-Cutting Defense: FSMs, Constraints, Atomic DML, and LockingWeb Security · Business Logic & Race ConditionsPractice this lesson →