Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...connecting to multiple databases from one web locationconnecting to multiple databases from one web location
Previous
 
Next
New Post
12/29/2008 11:35 AM
 

I am working on modifying DNN 4.9 to connect to multiple databases in order to power multiple sites from a single installation of DNN. Unfortunately we cannot use the portals solution because we have corporate requirements for data seperation (our clients also recieve backups of their databases on a regular basis and we cannot give the database of another client to them). We have a deployment process which keeps our clients all with the latest versions of whatever we are working on, but unfortunately it means that it currently takes about 5 mins to deploy to each client and install the latest modules (and the occasional DNN upgrade itself). Since we currently have one physical copy of DNN on the servers for each client, our deployment times are hovering around 2 hours right now (and we are expecting to have 8 times as many clients within the next year as we continue to bring in clients from an older system). We have some projects in the works which will cut our deployment times down to about 30 seconds per site (as we would no longer need to install modules), but we still will have multi-hour deployments (one advantage of the old system is that we have a <10 second deployment time).


The only way to speed up deployments is to get rid of the restriction that one directory on the webserver is tied to only one database and only serves one site and its portals. In order to do this I think we need to do two things:

1. modify the method Config.GetConnectionString to get the correct database connection string (we can call our IoC container here and get the actual connection string from a service that starts up on the first request to the site)

2. somehow modify something so that we are either using files from a different directory based on site location (eg if the virtual directory was dnn_c1 then use the folder dnn_c1_Portals instead of Portals for the portals folder) or (prefered) do not write any files to the webserver at all (skin and module installs are ok, because we can assure that if a file has the same name it is the same skin for two different clients).


Could anybody give some direction on what I am considering doing? I think the first item makes some sense, but nobody here is too sure about the second section. What areas would we need to modify?
 

 
New Post
12/29/2008 12:45 PM
 

You are right to want seperation between clients, but if you have restrictions on sharing the database between clients then I can't understand why you would allow the physical file and application space to be shared.

There are several reasons to avoid sharing the physical files/folders, the main one being that you probably do not want to upgrade every client at the same time. Also, if you have clients with different module needs you would not want them to all be loading their different modules into the same application (even if they don't show up in the module list they would still be sharing the same application pool).

It sounds like you are trying to avoid sharing the physical portal level files, but the only good way to do this is to have them each be in their own IIS application/website and pointing to their own installs.

If you automate your deployments (several hosting control panels can do this for you), then I think you'll get what you are after without having to modify DNN.

 


DotNetNuke Modules from Snapsis.com
 
New Post
12/31/2008 9:24 AM
 

We control the skins and the dlls that are installed for the clients and we manage the versions for their applications. All of them will always have all of the same skins, modules and dlls installed. We do update all of them at the same time. This is why we want to share the physical directory.

 

We also ultimately want to be able to have multiple web servers that are each connecting to any number of databases and serving for any number of sites.

Perhaps a picture would clarify things:

http://www.flickr.com/photos/16148317@N03/3152928823/in/set-72157611899142655/

 

 
New Post
12/31/2008 11:20 AM
 

If you really want to share the physical and application (memory) space, but not the DB then you could probably do it by adding a field to the Portals table that has the real database connection for each portal, then use that to get your connection string.  But that would mean you would have to set the connection string on every request, and you would also need to figure out how to keep the databases in sync on upgrades instead of the file system.


DotNetNuke Modules from Snapsis.com
 
New Post
12/31/2008 3:40 PM
 

We don't want to share application space, only physical space (eg all sites are located at c:\inetpub\dnn as the actual website folder). All virtual directories will be in their own app pools (well, 1 app pool per client; the linked image was portals on one level, then app pools then physical dirs then databases).

I am pretty sure that I can take care of the databases by replacing the contents of Config.GetConnectionString with the following:

Public Shared Function GetConnectionString() as String
    Return IoC.Resolve(Of ILocationInfo).ConnectionString
End Function

(we already have this interface locating another database that we need to connect to based on the website url)

This should take care of connection string issues simply by the fact that all websites are actually different locations. Unfortunately it doesn't take care of problems relating to files that have been written to the webserver. If Client1 creates a file with one name and Client2 creates a different file with the same name then I wind up with a conflict (suppose both upload an image for an html module on their homepage and they both call it home.jpg; or if both modify a language string that happens to be in the same file).

 

I think it could work if I were to ensure that each portal on each site was unique (ie site1 has portals 0,1 and 2, site2 has portals 3 and 4, site3 has portal 5 and site4 has portals 6 and 7). If I were to ensure that each site has unique portals then perhaps I can avoid nearly all file modifications; but I don't know the ramifications of not having a master portal available for each instance (ie the portalalias table would only have an entry for the specific portal for a particular site; site3 might have www.example.com/asdf linked to portal 5 and nothing would be linked to portal 0 for that database). What would be ramifications to doing this?

Our process for creating new sites would be:
1. visit the "empty" site as host
2. create portal "newsiteid"
3. make a copy of empty database and call it the newsiteid database
4. setup the information necessary to link the new location to the new database
5. make the new database think that the portal it is for is the host portal

 

Ultimately what we would end up with is a bunch of databases that are all copies from this original empty database and each have information about the portals created before them. The only question I guess is if information would bleed through from one portal directory to another.

The only issue this (as long as it would work) doesn't solve is the problem of actually writing files to the webserver at all. We want to be able to ultimately provide webfarm support for our clients without having a file server share (which is still a single point of failure) or doing replication and not to require a sticky session. We manage skins, modules and other things that can be installed on a site (and they are installed everywhere, 99% are developed in house).

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...connecting to multiple databases from one web locationconnecting to multiple databases from one web location


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out