3 ms·
Are data migrations easier with MongoDB/DynamoDB? They don't really have a schema.
by k__ 6y ago
Are data migrations easier with MongoDB/DynamoDB? They don't really have a schema.
- solumos 6y agoYeah, just shovel the data in. No schema, no problem. The tradeoff is that if you're actually relying on the structure of that data, you're introducing risk since its changes aren't being intentionally managed at the DB level.
- siliconwrath 6y agoWith document DBs you still have "schemas", they just won't be explicit at the database layer. If you rename a field your app uses, you will end up having to either rename that field in every document, or punt on migrating and instead ensure that your app can handle either field name when reading. While the latter may sound easier (and often is easier when you're starting out and iterating quickly), you will soon start to feel the pain of managing dozens of different versions of your "schema" at the app layer. I've always found it easier to only have to deal with a single schema at a time in any situation where you can't just regenerate all records on the fly, like a cache, and for which you don't care about what the specific schema was at a point in time. If you actually do care about what the schema was at any point in time at the app layer, your app WILL need to account for any version of the data—but if you need this you're accepting the tradeoffs of the additional complexity. Definitely more nuanced than "no migrations = easier" though.