I do not think there is one correct answer, it depends on your use.
If you have a very heavily used system, it is possible that the database performance will become a bottleneck, then you may need to shift the responsibility for checking to an external interface, where it is easier to scale using multiple servers.
If you have multiple applications that interact with the database, you may not want to replicate and support validation rules in multiple applications, so the database might be better.
You may need a slicker input screen that doesnβt just hit the user with validation warnings when they try to save the record, maybe you want to check the field after entering data and losing focus; or even by type of user, changing the font color, because the check is not performed / passes.
Also associated with restrictions, these are warnings about suspicious data. In my application, I have hard limits in the database (for example, someone cannot start working before the date of birth), but then there are warnings in the interface for data that may be correct but suspicious (for example, eight years -old getting started).
Guy c source share