0

I have a product, and a front end website where people can purchase the product. Upon purchase, I have a system that creates an A record in my DNS server that points to an IP address. It then creates a new IIS website with the bindings required.

All this works well, but I'm now looking at growing the business and to do this I'll need to handle upgrades of the application.

Currently, I have my application running 40 websites. It's all the same code base and each website uses it's own SQL Server database. Each website is ran in a separate application pool and operate completely independently.

I've looked at using TeamCity to build the application and then have a manual step that runs MSDeploy for each website but this isn't particularly ideal since I'd need to a) purchase a full license and b) always remember to add a new website to the TeamCity build.

How do you handle the upgrade and deployments of the same code base running many different websites and separate SQL Server databases?

1 Answer 1

1

First thing, it is possible to have a build configuration in TeamCity that builds and deploys to a specific location...whether a local path or a network drive. I don't remember exactly how but one of the companies I worked with in Perth had exactly the same environment. This assumes that all websites are pointing to the same physical path in the file system.

Now, a word of advice, I don't know how you have it all setup, but if this A record is simply creating a subdomain, I'd shift my approach to a real multi-tenant environment. That is, one single website, one single app pool for all clients and multiple bindings associated to a specific subdomain. This approach is way more scalable and uses way less memory resources...I've done some benchmark profiling in the past and amount of memory each process (apppool) was consuming was a massive waste of resources. There's a catch though, you will need to prepare your app for a multi-tenant architecture to avoid any sort of bleeding such as

  1. Avoiding any per-client singleton component
  2. Avoiding static variables
  3. Cache cannot be global and MUST a client context associated
  4. Pay special attention to how your save client files to the file system

Among other stuff. If you need more details about setting up TeamCity in your current environment, let me know. I could probably find some useful info

Sign up to request clarification or add additional context in comments.

3 Comments

I'd love to move to a real multi-tenant environment, but each website uses it's own cache strategy (depending on the client), uses a unique SQL Server database together with a whole heap of settings for that installation. Combining everything to be a true multi-tenant environment would require a total re-write unfortunately. Maybe I could use team city to deploy to a location and then have a custom application to do the deployments to each site... I think whatever I do will be a whole heap of fun!
@Paul I do feel your pain mate. I hate to say it but this sounds like the result of making bad decisions from the beginning. I still strongly recommend you to look at multi-tenancy, it DOES NOT necessarily involve a complete re-write, only addressing where you handle client's data that's not associated to the client's context. Having a per-client caching strategy it's not a show-stopper you can simple load at runtime a specific caching component based on the current context using IoC/DI pattern...there's a few 3rd paty tools out there for this purpose such as Windsor Castle IoC
Thanks for your input Leo, appreciate it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.