4 ms·
Definitely. You won't have the rich exception messages all over. However, if the rule is a _business rule_ then it must either live _in_ the DB, or (very freque
by JamesSwift 6y ago
Definitely. You won't have the rich exception messages all over. However, if the rule is a _business rule_ then it must either live _in_ the DB, or (very frequently) live in a dedicated repository layer that all application access goes through. Otherwise its not a rule and you _will_ forget to enforce it at some point.
- berkes 6y agoThis is the distinction we make too: business validations go in the database, ux-validations go in the application. In practice, however, this means the business validations are duplicated all over the place (but always enforced, as last line of defence, in the database). It also means customers get more frequent 500 errors (exceptions): when a business rule is implemented in DB but not (yet) in an application. It is messy.