I'm talking about not doing shit like XML parsing (https://www.postgresql.org/docs/9.6/static/functions-xml.htm...), or LDAP queries (https://docs.oracle.com/cd/B10501_01/network.920/a96577/dbms...) in the database. I don't think those things belong there.
Serves me right for leaving a blank on HN! People here just love to fill those with 'herp derp'.
Front end (JS SPA) for the convenience of users.
Back end API (any web framework) for the convenience of developers, the users of the API.
The database to make sure nobody can corrupt the data.
In my experience the validations in the database almost never go past foreign keys, null fields and bounds on numeric data.
Anecdote. I remember when the consensus of Rails developers was not to use foreign keys: Rails didn't have a way to define them so they probably didn't matter, right? I laughed and added them to every application of mine. Rails has foreign keys now, maybe since version 3.
There are some gems to generate CHECK statements from validations.
The ability to stop modifications inside the db is the ultimate safeguard against data corruption. If you really value your data you should also implement validations with CHECK statements and not only in the application. Think about the database as another microservice worth its own logic.