2 ms·
How do people typically do migrations in production anyway - what tools are used? what are the best practices?
by ps256 3y ago
How do people typically do migrations in production anyway - what tools are used? what are the best practices?
- meowtimemania 3y agoAt my job we do database migrations 1 week and then deploy code the next. That way if any problems happen in either, it’s easier to roll back.
- lazyant 3y agoFlyway and Liquibase are typical migration tools. Best practice is to have your new code backwards-compatible with the old schema so you can do blue-green deployments.
- peter_l_downs 3y agoFlyway is generally the most popular. Django/alembic in the python world. I think most migration tools are missing a lot of features that would make them safer and easier to use. Modern teams merge a lot and deploy frequently, but most migration tools are built for a db admin manually running commands. I wrote a migration cli tool (and golang library) that I think is more suited to modern workflows, if you check it out I’d appreciate any feedback! https://github.com/peterldowns/pgmigrate https://github.com/peterldowns/pgmigrate
- claytonjy 3y agoI used sqitch in a past job and loved it, but I had to basically implement what pgroll does automatically in order to ensure smooth migrations, and I hit plenty of issues along the way. Learned a lot, but pgroll looks much friendlier.