TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How do you deploy code with breaking database changes?

1 点作者 qd011大约 1 年前
Deploying new code which relies on a non-backward-compatible database changes - how do you update the application and the database without any downtime?<p>What tools and processes do you use for this? Are there any established best practices?<p>For more context, I&#x27;m using a managed SQL database and the application runs on Kubernetes.

2 条评论

gigatexal大约 1 年前
Generally if you take the always append columns never drop or rename existing ones you’ll be okay. (Then once everyone moves over to the new stuff you can drop or otherwise cleanup the table).<p>Make alter table statements, depending on the engine some can be non-locking&#x2F;blocking.<p>Deploy code.<p>Enjoy.
UK-Al05大约 1 年前
Normally all breaking changes can be broken up into 2.<p>First add the additions to the db, then the new version of the software can work with the db.<p>Then once all software is updated, remove the old fields.