4 ms·
This is a big reason why I like Datomic so much. I get the benefits of a schema, but the schema is basically append-only, so it's very easy to reason about. Upd
by john-shaffer 6y ago
This is a big reason why I like Datomic so much. I get the benefits of a schema, but the schema is basically append-only, so it's very easy to reason about. Updating the schema is instant.
The last time I tried a project with a no-schema DB, it was a huge PITA. It sucks having a function fail on one single document because it had a number instead of a string. I love flexibility, but it is very valuable to have the right constraints in the right places. I quickly learned that a schema is just that.
- doteka 6y agoI don’t see how you’d have a number instead of a spring in a document in a typed language. Do you just directly dump user supplied data in your database without parsing/processing it? Otherwise, how is this not caught when it enters your system?
- loopz 6y agoIt is caught by the schema and never stored in the first place. Or you can solve it for every column/field in your system manually, and probably introduce subtle bugs and inconsistencies along the way. I'm for schemas, but not necessarily RDBMS for everything.
- john-shaffer 6y agoMost document databases have JSON editors, which are very useful at times but don't have any schema checks. By "typed language" I suppose you mean "statically typed language". This isn't relevant because A) JSON types exist and B) I've never had a problem with unexpected types from user data in a dynamic language, not even in PHP. > Otherwise, how is this not caught when it enters your system? It should be caught, and it's very important that it be caught all of the time and not have any issues due to bugs or version mismatches. That's why the schema should live in the DB.