DEV Community

Discussion on: Database constraints considered harmful?

Collapse
 
jeremyf profile image
Jeremy Friesen

I used to work in insurance, and the very thought of having data integrity enforced at the application layer sends shudders down my spine.

Why? Because what happens if two duplicate emails exist in the users table for the same human being? It creates problems. Which user record gets the bill? Are there two different bills?

I advocate for validations at the layer where if they were missing, they would cause the most mayhem.