2 ms·
> "Schemaless" just immediately means that instead of the database keeping consistency, you now essentially have to do all your type and constraint checking in
by mooreds 8y ago
> "Schemaless" just immediately means that instead of the database keeping consistency, you now essentially have to do all your type and constraint checking in the application...
This is so true. Some component has to maintain integrity of the data. Should it be the application developer? Or the database software team?
I know which one I'd choose, and which one is focused on data integrity and not business logic.
- anyfoo 8y agoAnd it’s not just who you trust, it’s also at what layer you want to enforce your integrity and consistency. Not letting the db do that means that every part of the application that touches the database needs to do that enforcement. Even if you abstract that away into a strict layer directly above the database—which essentially means you’ve just implemented parts of a database on top of a database—you have to essentially invent and implement the methods and languages to do so yourself. At which point you’re pretty much guaranteed to be much worse of then if you had just let the DB do it. This might mean handling unexpected errors if you have a bug in your application logic, but that’s usually orders of magnitude better than introducing hard to fight inconsistencies.
- jerrysievert 8y ago> This is so true. Some component has to maintain integrity of the data. Should it be the application developer? Or the database software team? if you're using partitioned (inherited) tables in Postgres, then it's the application developer, as foreign keys on inherited tables don't really work. the workaround is triggers.