保持生产和开发之间文本同步的程序
我们有一个生产数据库,其中的文本显示在我们的网站上。 我们还有具有多个分支的开发服务器(生产数据库的多个副本)。
我们遇到的问题是,在开发过程中,我们在每个分支中添加和更改文本。我们还在生产环境中更改文本。
如果开发和生产更改了相同的文本,则很难找到如何合并这些更改。
我们认为我们只能对生产数据库进行更改,并且只能在开发数据库上添加文本。但这将为我们提供许多具有不同键的文本,这些文本具有几乎相同的数据。
您如何处理环境之间的文本更改?
谢谢!
We have a production database with texts that shows on our web site.
We also have development servers with multiple branches (several copies of the production database).
The poblem we have is that during development we add and change texts in each branch. And we also change texts in our production environment.
If development and production has changed the same text it's hard to find our how to merge these changes.
We were thinking of that we only can make changes on the production database and only add texts on development database. But that would give us many many text with different keys that has pretty much the same data.
How do you handle text changes between environments?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个相当常见的问题 - Martin Fowler 不久前写过这个问题 (http://martinfowler.com/文章/evodb.html)。
没有好的、简单的、无痛的解决方案 - 但 http://www.amazon.com/ Recipes-Continously-Database-Integration-ebook/dp/B000RH0EI4 可能是关于该主题的最好的书......
这是一项相当重大的任务,需要开发团队的大量纪律 - 但它是值得的如果您遇到您所描述的问题。
它归结为编写数据库创建/修改任务的脚本,并将这些脚本提交给源代码控制。您可以使用命名约定来确定运行脚本的顺序,然后在设置环境或将新版本部署到该环境时使用自动化流程来运行它们。
This is a fairly common problem - Martin Fowler wrote about it a while ago (http://martinfowler.com/articles/evodb.html).
THere's no nice, simple, painless solution - but http://www.amazon.com/Recipes-Continuous-Database-Integration-ebook/dp/B000RH0EI4 is probably the best book on the topic....
It's a fairly major undertaking, and requires a lot of discipline from your development team - but it's worth it if you're running into the problems you describe.
It boils down to scripting your database creation/modification tasks, and committing those scripts to source code control. You use a naming convention to determine the order in which to run the scripts, and then have an automated process to run them when setting up an environment, or deploying a new version to that environment.