views:

138

answers:

2

Ok, so here's the thing.

I'm developing an existing (it started being an ASP classic app, so you can imagine :P) web application under ASP.NET 4.0 and SQLServer 2005. We are 4 developers using local instances of SQL Server 2005 Express, having the source-code and the Visual Studio database project

This webapp has several "universes" (that's how we call it). Every universe has its own database (currently on the same server) but they all share the same schema (tables, sprocs, etc) and the same source/site code.

So manually deploying is really annoying, because I have to deploy the source code and then run the sql scripts manually on each database. I know that manual deploying can cause problems, so I'm looking for a way of automating it.

We've recently created a Visual Studio Database Project to manage the schema and generate the diff-schema scripts with different targets.

I don't have idea how to put the pieces together

I would like to:

  1. Have a way to make a "sync" deploy to a target server (thanksfully I have full RDC access to the servers so I can install things if required). With "sync" deploy I mean that I don't want to fully deploy the whole application, because it has lots of files and I just want to deploy those new or changed.
  2. Generate diff-sql update scripts for every database target and combine it to just 1 script. For this I should have some list of the databases names somewhere.
  3. Copy the site files and executing the generated sql script in an easy and automated way.

I've read about MSBuild, MS WebDeploy, NAnt, etc. But I don't really know where to start and I really want to get rid of this manual deploy.

If there is a better and easier way of doing it than what I enumerated, I'll be pleased to read your option.

I know this is not a very specific question but I've googled a lot about it and it seems I cannot figure out how to do it. I've never used any automation tool to deploy.

Any help will be really appreciated,

Thank you all,

Regards

+1  A: 

Have you heard of the term Multi-Tenancy? It might be worth look that up to see if that applied to your "Multiverse" especially if one universe is never accessed by another...

See:

http://en.wikipedia.org/wiki/Multitenancy

http://msdn.microsoft.com/en-us/library/aa479086.aspx

UPDATE:

If the application and database is the same for each client (or Tenant) I believe there are applications that may help in providing the same code/db as an SaaS application? ie another application/configuration layer on top that can handle the deployments etc?

I think these are called Platform as a Service (PaaS) applications:

see: http://en.wikipedia.org/wiki/Platform_as_a_service

Multi-Tenancy in your case may be possible, depending on client security requirements, with a bit of work (or a lot of work):

Option 1:

You could use the one instance of the application, ie deploy the site once and connect to a different database for each client. You would need to differentiate each client by URL to isolate content/data byt setting a connection string for each etc. (This would reduce your site deployments to one deployment)

Option 2:

You could create both a single instance of the application and use a single database. You would need to add a "TenantID" to each table and adjust all your code to accept a TenantID to ensure data security/isolation. Again you wold need to detect/differentiate the Tenant based on the URL to set the TenantID for the session used for every database call. (This would reduce your site and database deployment to one of each)

Mark Redman
Never heard of it, but it seems what I have. Each "universe" is totally isolated from each other, there's no interaction between them. Anyway, those links are pretty theorical, and how to build a multi-tenancy structure. I already have the structure, I just only need an automated way of deployint it. Thanks anwyay.
emzero
Well, actually we have a structure like option 1. Due to policy stuff we need to have one separated db per client, as they don't like to share the same db with other clients. But my question is more specific to the process of making an automated deployment of the application code and the databases scripts. How to unify everything into an automated process.
emzero
A: 

Hi emzero,

I am really glad that you very quickly realized the problems and non-scalability of manual and scripted deployments. Working with many industry analysts, we are definitely seeing a shift in the way applications are getting deployed to the data center.

You should keep on looking at application release automation solutions such as NAnt, Phurnace, RPath, ControlTier and Nolio.

I can personally help you to get started with Nolio, especially if you have a smaller setup, then the free Nolio Express is available for managing deployments on 10 servers. http://www.nomorescripts.com.

Cheers, Daniel

Daniel Kushner