So you wrote your app with mongodb and went live. Maybe some small changes to db structure aren't that big of a deal but eventually, you need to migrate data.<p>How have you guys been handling migrations in mongo?
For really deep, structural (and large datasets), then it's pretty difficult to avoid downtime.<p>That said, those circumstances are hopefully pretty rare. We generally write scripts that bridge between the two formats. One to copy/transform and one to cleanup after. Run the transform, test and verify, then move to cleanup.<p>It's a huge pain, but if you keep on top of if --especially the cleanup-- then it gets easier. It tends to get really hard once you get a lot of cruft. You end up with the code vs data dichotomy. So keeping on top of that really helps longer term.
It's been a while since I've played with mongo, but you could run an out-of-band task to run through all existing data, transform, then push into a new DB / instance.<p>Your existing server would continue, you have a new endpoint to test with updated application code, deployment can then be a standard blue-green approach.