News for hackers. Stuff that matters.
Re:Ask HN: How much logic should I keep at the database vs. ... by floppydisc on Friday February 18, 2022 @03:54AM (#30383517)
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.

There are no comments on this comment yet.