3 ms·
This list makes me want to cry a little. It rings too true. > Have migrations (except they're going to be some scary ad hoc nodejs script that loop through you
by nulagrithom 10y ago
This list makes me want to cry a little. It rings too true.
> Have migrations (except they're going to be some scary ad hoc nodejs script that loop through your document store and modify fields on the fly).
I literally just spent the better part of tonight AND yesterday evening dealing with one of these scripts. I had pulled down the production table to locally test the script (gross), but when I later ran it in the production environment, we'd somehow had an array sneak in to what was an object field. The whole thing just felt like a mess.
- Lazare 10y agoOh god, I'm getting flashbacks. Because you can't just test it on one document and see if it works; you have no guarantee that all the documents will be identical. And if the migration script crashes halfway through... oh man.
- krylon 10y ago> And if the migration script crashes halfway through... oh man. Schema-issues and typing aside, I looked at MongoDB just long enough to find out there are no transactions, then ran away, quickly. For a lot of tasks, I guess I would find MongoDB very useful, but lack of transactions is a complete deal breaker for me. Not having a real schema, referential integrity and all that makes them even more important, IMHO. At work, I have had more than one quickly-hacked-together Perl script crash on me in the middle of a run. Having proper transactions has saved my butt repeatedly.
- nathan_long 10y agoBy contrast, with Postgres you'd have an explicit schema which all records obey, and even migrations can be done in transactions.