7 ms·
> if you don't express the update rules in a database schema, it must be in the application code. Subtle errors are more likely in that case. This is a common
by petalmind 2y ago
> if you don't express the update rules in a database schema, it must be in the application code. Subtle errors are more likely in that case.
This is a common sentiment but I think that you can always demonstrate a use case that is very much practical, not convoluted, and could not be handled by classical features of relational databases, CHECK primarily (without arrays of any kinds).
A couple of examples is outlined here: https://minimalmodeling.substack.com/i/31184249/more-on-structural-validations https://minimalmodeling.substack.com/i/31184249/more-on-stru...
Basically I'm currently pretty much sure that it's impossible to "make invalid states unrepresentable" using a classical relational model.
Also, I think that if your error feels subtle then you should elevate the formal model to make it less subtle. You can have "subtle" errors when the checks are encoded as database constraints too.
- wpollock 2y ago>Basically I'm currently pretty much sure that it's impossible to "make invalid states unrepresentable" using a classical relational model. But that's what 9th NF is for! :-)