|
|
|
|
|
by chatmasta
2594 days ago
|
|
Foregoing triggers in favor of validating data in the application layer can be dangerous. The problem is that you need to re-implement data validation on every path to the database. If you've got a single application server, and it's the only client that ever writes to the database, this might work. But as soon as you add another service with write capability, you need to re-implement the validation logic. What if you forget? If you put the validation in the database, any application can leverage it. If you want to fail fast, you can still do validation in the application layer while relying on the DB layer as the ultimate validator. |
|
Also you can end up with services communicating between an implicit database api rather than a well established rest or rpc (or whatever) api.