部署ASP.NET Web站点,并更新MSSQL数据库零停机 [英] Deploy ASP.NET web site and Update MSSQL database with zero downtime

查看:151
本文介绍了部署ASP.NET Web站点,并更新MSSQL数据库零停机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对ASP.NET web站点和MSSQL数据库的部署问题。我们是东道主asp.net网站开发新版本中,一些asp.net文件被更改和数据库被修改了一点。什么是无需停机最好的,为什么要上传网站的新版本和升级MSSQL数据库?

I have question about ASP.NET web site and MSSQL database deployment. We are hosting asp.net web site and developed new version, the some asp.net files are changed and database is modified a little. What is the best why to upload new version of web site and upgrade MSSQL database without downtime?

推荐答案

我已经管理的大型网站,在过去5年,每月发布并管理具有零停机时间95%以上。关键的,不幸的是确保数据库始终是向后兼容的,但仅限于previous释放,让你有机会回滚。

I've managed a large website for the past 5 years with monthly releases and manage to have zero downtime more than 95% of the time. The key, unfortunately, is ensuring that the database is always backwards compatible, but only to the previous release, so you have the opportunity to rollback.

所以,如果你打算删除列,例如,您的应用程序依赖于:

So, if you plan to drop a column, for example, that your application depends on:


  1. 更改应用程序code到不依赖于列,并释放(没有在数据库中删除列)。

  2. 下一步释放下拉列(如应用程序不再依赖于它)。

  1. Change your application code to not depend on the column, and release that (without removing the column in the database).
  2. In the next release drop the column (as the application no longer relies on it).

这需要一些纪律从你的开发团队,而且是非常容易实现,如果你有适当的正确的环境设置(开发/测试/分期/生产)。

It takes some discipline from your dev team, but is surprisingly easy to achieve if you have proper the right environments setup (dev/test/staging/production).

当你释放:


  1. 部署数据库更改为上演的环境,这是接近生产越好。 pferably做到这一点$ P $以自动方式,使用类似SQL比较和SQL数据比较,让你知道数据库完全是最新的与您的测试环境。

  2. 执行冒烟测试使用的应用,但在数据库架构,确保无重大重大更改已被引入到数据库中。

  3. 释放你的应用程序code。

  4. 烟雾测试您的应用程序升级。

  5. 发布到生产。

  1. Deploy database changes to a staging environment, which is as close to production as possible. Do this preferably in an automated fashion, using something like SQL Compare and SQL Data Compare, so you know the database is completely up to date with your test environment.
  2. Perform "smoke tests" using the old application, but the new database schema, ensuring no major breaking changes have been introduced to the database.
  3. Release your application code.
  4. Smoke test your staging application.
  5. Release to production.

我们做,以确保在网站上零停机时间的另一件事是蓝绿色的部署。这包括有2个文件夹为每个网站,最新情况,并切换IIS主目录一旦它是最新的。我的博客上讲述这个位置:<一href=\"http://davidduffett.net/post/4833657659/blue-green-deployment-to-iis-with-powershell\">http://davidduffett.net/post/4833657659/blue-green-deployment-to-iis-with-powershell

Another thing we do to ensure zero downtime on the website is blue-green deployment. This involves having 2 folders for each website, updating one and switching the IIS home directory once it is up to date. I've blogged about this here: http://davidduffett.net/post/4833657659/blue-green-deployment-to-iis-with-powershell

这篇关于部署ASP.NET Web站点,并更新MSSQL数据库零停机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆