News for hackers. Stuff that matters.
Re:Consistency is Consistently Undervalued by tscs37 on Monday September 19, 2016 @05:44AM (#12530094)
IMO validating in the DB also makes code faster.

When I get data from a well validated DB, I don't have to check that it is valid or has certain formats, that is ensured by the DB.

I can remove checks from the entire CRUD stack, if it's invalid data it does not get created or won't make it into the update.

The easiest way to check data is then to try the INSERT or UDPATE and if it works it's valid.

Otherwise I'd need to validate all fields, see if any contain errors, if any are missing, etc etc.

There are no comments on this comment yet.