简体   繁体   中英

Multi-Tenant Database & One Model - MVC & Joomla

I'm developing a component which has the below structure. This system is developed under Multi-Tenant concept.

在此处输入图片说明

www.a.com, www.b.com, www.c.com are web sites which are in different domains but they run the same system . Each website have their own template and web pages in their local database . That's doable.

The system which is ran on these three sites are independent from the mentioned above(templates etc). www.a.com, www.b.com, www.c.com have a one large database where all the system data is maintained . Since the system is developed according to MVC what I want to do is have a single model(multiple models) where all the logic is contained. So if I make a single change in the model it affects the 3 sites.

According to my research, model should be maintained in the cloud. How can I implement such a requirement with MVC(Given I'm using Joomla as my CMS, MySQL as DBs) ? How can I have a single model for all the 3 sites ?

You can put more than one domain on the very same joomla installation without any changes, just add a plugin that's called virtualdomains which will allow you (for free) to choose template and - thus - menus, extensions and available pages for each domain; Maintenance-wise this will be easy since all is in one box; but the users will see three sites with different content, layout and urls.

Just a couple of warnings: 1) make sure no scripts or css or other local resources are invoked with the url (http://www.a.com/template/xxx/js/jquery.autocomplete.js) vs /template/xxx/js/jquery.autocomplete.js, the first will work badly with cache. 2) handle any intricacies such as same-url on different domains with .htaccess; use a sh404 or similar component to manage the SEF urls.

This model looks quite complicated to me.

It depends what the main goal of this? Its just fetching all articles/users together? But why?

If you are dealing with problem of running one project on multiple Joomla installations I can advise you to put them on single Joomla and than using Virtual Domains ( http://extensions.joomla.org/extensions/core-enhancements/multiple-sites/7557 ) for "copying" the website on other domains. Then you will one database for all your project.

One downside of this is that its mainly suitable for the projects with same component and article structure. Meaning for example local news divided by regions under different domains etc.

For the reference: the solution is really working fast on Joomla 2.5 latest update.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM