Any possible troubleshootings with two Orchard mirror sites working with the same database?

Topics: Administration, General
Nov 14, 2013 at 4:16 PM
Edited Nov 15, 2013 at 11:13 AM
Hello.

We have two Orchard mirror sites that currently working with the same database. Like this:
Image
Both websites files are synchronised.
Orchard version is 1.7.1.

So far they are working fine, but to try understand Orchard better is there any possible issues that this scheme can cause? Can anyone help me with this question?
For example:
Recently I've discovered that when any module gets enabled/disabled then in the database they (all enabled modules) get reinserted into the database with new id-s.
And I don't know how second website (means mirror #2) will behave if I'll disable/enable some module on the first website (mirror #1). But so far this haven't caused any troubles though.

Was Orchard designed to support such scenario, means to share one database with other mirrored Orchard website(s)?

Any help appreciated.

Thanks!
Coordinator
Nov 16, 2013 at 6:47 AM
Yes, a lot of things need to be taken care of. First, of course, the database needs to be a full SQL Server, not CE. Second, any caching should be distributed (memcached for instance). You should also look at the task lease module, and make sure that when changes of configuration occur that require a restart of the application (such as enabling modules), all mirrors get restarted.
Nov 18, 2013 at 4:58 PM
Edited Nov 18, 2013 at 6:53 PM
Thanks Bertrand for your response.

I found some topics related to what you had said:
http://docs.orchardproject.net/Documentation/Deploying-Orchard-to-Windows-Azure
https://orchard.codeplex.com/discussions/254456
https://orchard.codeplex.com/discussions/389349

Just to summarise what I've understood what should be taken care of are:
1.. Database - SQL Server.
2.. Session state.
The web farm needs to be configured for shared session state. This has the consequence that objects put in session by modules should be serializable.
3.. Machine key: the machine key must be set to the same value on each machine of the farm.
4.. Module installation.
You need to either synchronize the modules and themes folders of your sites, or you need to refrain from installing modules and themes from the production server and instead deploy the installed modules from your dev/staging environment.
5..
To make sure that when changes of configuration occur that require a restart of the application (such as enabling modules), all mirrors get restarted.
6.. Media folder.
Orchard media files are stored in the local file system. This won't work as the file systems or the different instances will soon start to diverge as users add/remove media.
7.. Caching.
Orchard output caching and database caching (NHibernate second-level cache) use local memory for storage. This won't work as content might be updated on one instance and any cached copies invalidated there, while other instances continue unaware of this change.
I didn't miss anything?
Coordinator
Nov 18, 2013 at 5:38 PM
Don't attempt to sync cache.dat and mappings.bin. Those are generated.
Nov 18, 2013 at 6:54 PM
Edited Nov 18, 2013 at 6:55 PM
Ok. Thanks! I've edited the post.