3 ms·
the view I now have is that for a relational table, yes you have to suffer through migrations but at least they are in sql. for document based stores, you still
by jimmyl02 2y ago
the view I now have is that for a relational table, yes you have to suffer through migrations but at least they are in sql. for document based stores, you still have to have migrations, but they are just implemented in code
json documents sound great, especially initially, but end up being a maintenance nightmare
- hans_castorp 2y ago> for document based stores, you still have to have migrations, but they are just implemented in code The problem with that - in my experience - is that migrating the structure for thousands (if not millions) of documents is way slower than running a DDL command (as it means reading each document, parsing it, modifying it and writing it back). Many DDL commands are just metadata update to the system catalogs so they are quite fast (e.g. adding a new column with a default value). With documents you wind up with millions of single row updates. This can be mitigated by doing a "lazy" migration when a document with the old structure is first read. But that makes the code much more complicated.
- globular-toast 2y agoOr, to put it another way, yes you have to write and maintain an upfront schema, but a document-based system has a schema too, it's just distributed amongst 50 codebase and 10 people's heads.