views:

131

answers:

3

We have an internal web system that handles the majority of our companies business. Hundreds of users use it throughout the day, it's very high priority and must always be running. We're looking at moving to ASP.NET MVC 2; at the moment we use web forms. The beauty of using web forms is we can instantaneously release a single web page as opposed to deploying the entire application.

I'm interested to know how others are deploying their applications whilst still making them accessible to the user. Using the deployment tool in Visual Studio would supposedly cause a halt. I'm looking for a method that's super quick.

If you had high priority bug fixes for example, would it be wise to perhaps mix web forms with MVC and instead replace the view with a code-behind web form until you make the next proper release which isn't a web form?

I've also seen other solutions on the same server of having the same web application run side-by-side and either change the root directory in IIS or change the web.config to point to a different folder, but the problem with this is that you have to do an entire build and deploy even if it were for a simple bug fix.

EDIT: To elaborate, how do you deploy the application without causing any disruption to users.

How is everyone else doing it?

A: 

Have multiple instances of your website running on multiple servers. The best way to do it is to have a production environment, a test environment, and a developement environment. You can create test cases and run the load every time you have a new build, if can get through all the tests, move the version into production ;).

shawnjan
Yes, but the question is _how_ do you move it into production without causing disruption to users?
Kezzer
+1  A: 

I guess you can run the MVC application uncompiled also? and just replace .cs/views and such on the run.

A websetup uninstall/install is very quick, but it kills the application pool.. which might cause problem. Depending on how your site is built.

The smoothest way is to run it on two servers and store the sessions in sql server or shared state. Then you can just bring S1 down and patch it => bring s1 back up again and bring S2 down => patch S2 and then bring it up again. Al thought this might not work if you make any major changes to the session parts of the code.

Carl Bergquist
Yeah, I expected this to be the answer. You don't need two servers either, you can just run it on one server and share the session state via the asp instance meaning you don't have to use SQL, so it's much faster as it's "InProc".
Kezzer
A: 

You could have two physical servers each running IIS and hosting a copy of the site. OR you could run two copies of the site under different IIS endpoints on the SAME server. Either way you cut it you are going to need at least two copies of the site in production.

I call this an A<->B switch method.

Firstly, have each production site on a different IP address. In your company's DNS, add an entry set to one of the IPs and give it a really short TTL. Then you can update site B and also pre-test/warm-up the site by hitting the IP address. When it's ready to go, get your DNS switched to the new site B. Once your TTL has expired you can take down site A and update it.

Using a shared session state will help to minimise the transition of users between sites.

Rob King