2 ms·
As a rule I generally keep most in the app layer after some annoying runins with too much logic at the database layer. Simple validation, like describing that
by floppydisc 5y ago
As a rule I generally keep most in the app layer after some annoying runins with too much logic at the database layer.
Simple validation, like describing that a price cannot be below 0, I keep in the database. Email validation I keep on the app level.
It allows for easier deployments, easier debugging and it is easier to migrate to a different database should the need arise.
However both works.