databasessql
put uniqueness rules in the database
Anonymous
An application-side check followed by an insert can race: two requests may both see that a value is absent. A unique constraint enforces the rule at the database boundary; handle the conflict in the application.
0