|
|
|
|
|
by agentultra
3345 days ago
|
|
Your data is your domain. If you don't understand your data then you don't understand the problem. If there's a business rule for how that data is handled then it's most consistent to define it in the server that is purpose built to manage your data. Especially when it has built in facilities to constrain possible states. I've seen too many programmer bugs to trust putting business logic outside of the DB. Separation of concerns here too just on different lines of concern. |
|
That's a rather sweeping statement, that many in the industry do not agree with.
https://en.wikipedia.org/wiki/Domain-driven_design https://martinfowler.com/
> If there's a business rule for how that data is handled then it's most consistent to define it in the [db]
To be clear, you're proposing that all business rule validation should be implemented as stored procedures in the DB? One of my domain model aggregates consists of thousands of lines of code just enforcing business rules and constraints. Am I to put that all in the DB?