Skip to content

sqitch migrations while "live" #646

Answered by theory
dhess asked this question in Q&A
Discussion options

You must be logged in to vote

In this situation, is it generally safe to run the sqitch migration from version n to n+1 while clients are actively using the database?

In general, yes, I think so. Of course it very much depends on the change. For example, if you add a new column with a default value to a table with, say, a billion rows, depending on your database engine and version, it could require a rewrite of the entire table, which would put a lot of pressure on clients and could greatly increase query latency. A better approach is to use a version of a database that dynamically assigns missing defaults at query time, like Postgres 11, or else don't include a default and dynamically assign it when missing in your n…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dhess
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants