Hello. I have not been able to determine whether Drupal supports multi-tenancy (reference: http://en.wikipedia.org/wiki/Multitenancy). Specifically, I am interested in a single Drupal installation supporting multiple user organizations that would share the same environment but be able to have separate interface configurations and settings, and otherwise being totally unaware of other tenants (users). An example would be a single install of Drupal being used to serve up multiple organizational websites in a SaaS type offering.

Does anyone have any information on this?

Thank you.
David

Comments

ajayg’s picture

Configure drupal in a multisite configuration. One drupal codebase can serve many different domains or subdomains.

dpaolicelli’s picture

Thank you! -David

arbermudez’s picture

how would I do this if my instance of drupal is seperate from my main site?

For example I have mysite.com/drupal but I want to create multiple sites using that instance...

4cornersusa.com’s picture

you need to create symlinks or use your Cpanel depending on What host you have.

webdevguy’s picture

Running multiple sites with one codebase is different from multitenancy. Multitenancy is use on something like salesforce.com where it's one domain, a user signs up on the site and it's like the software is all his, noone else can see his data and vice versa.

webdevguy’s picture

Multi-site is different from multitenancy. Multisite is for multiple "separate sites" - separated by subdomains or domains. Multitenancy is on ONE site, you ave multiple entities (not meant in drupal parlance), say multiple companies, using ONE site/codebase, and each company sees ONLY their data. There is only one extra field needed to distinguish them, but I can not find it.

webdev2’s picture

I recently asked the same question. As far as I can see, the answer is no - at least not that I know of yet. I work in the SaaS space and have not yet seen how Drupal can make a true SaaS.

4cornersusa.com’s picture

You can setup multisite-single DB, multisite-multi DB, for full domains or subdomains.

The best place to ask this question is in the search box at the top of the page. You will find many How-to's.

To get you started I am adding the links from the pages that were helpful to me;
http://drupal.org/node/107347 - NOTE: with a host that has Cpanel-11 you do not need to worry about the mentioned symlink thing.
http://drupal.org/node/138889 - NOTE: covers installing on LAMP
http://drupal.org/project/multisite_manager - NOTE: I haven't used this yet, but it looks promising fro automating multisite setup.

That should get you started.

webdev2’s picture

A true SaaS is one domain name where you log in and see only your data/nodes AND, at that same domain (without subdomains) I log in and see only my data. Most of my applications are built this way. It's not hard to do building your own software but his point is, I think, is wondering how to do the same thing using Drupal.

So it's not mult-site, that's a completely different concept compared to SaaS.

Let's take a salesforce.com me-too package called sugarCRM, virtually the same thing as salesforce.com. I register and enter my data. No one else can see any of my data except me. To use it, everyone logs in to the same domain name.

Hope that helps.

-Anti-’s picture

> No one else can see any of my data except me

So why would anyone expect a website application like Drupal to be able to do this?
After all, the whole point of a website is to disseminate information to other people.
Seems like a SaaS is a fairly specific sort of application?

webdev2’s picture

You're right. I don't think Drupal is the platform for a true SaaS. I had asked a similar question a month ago and now realize, at least from where I am in the learning, the Drupal is not a good choice for a SaaS application.

There might a way to add an special ID field and then filter views based on that field. But so far, I could have built two or three SaaS in the time I've been learning to use Drupal.

So, you're right. Drupal has a great product and I intend to use it to for some applications, just not SaaS.

-Anti-’s picture

> NOTE: with a host that has Cpanel-11 you do not need to
> worry about the mentioned symlink thing.

More info please. My host has cpanel11, and I found it still necessary to create symlinks.

Cheers.

amr.abou-elenin’s picture

i know that the article is very old ,
but i just want to add that , the real saas that drupal is providing is in drupal garden
http://www.drupalgardens.com/

regards ..

pareen’s picture

I don't see any Drupal SaaS application apart from Drupal Gardens.

Multi-site is something different.

Drupal Gardens is real SaaS platform where:
- one client can signup
- creates a separate site/space/context/instance that only that customer can manage
- on a subdomain or a custom domain name

Something like Basecamp.

Has anyone found a way to do this?

gloscon’s picture

Not sure if true Multi-Tenant architecture based case studies are out there with Drupal. Would love to hear more on this.

voipfc’s picture

pareen’s picture

Hi,

Are there any practical tutorials available for making Drupal multi-headed.

The article at Palantir is awesome. But its a conceptual overview.

thememex’s picture

I know this is an old question, but for those searching for a solution today you should use Organic Groups.

OG is the Drupal equivalent suite of modules that allows developers to build a multi-tenant app.

For a really quick start with OG, try using the free Drupal Commons 7.x.
https://drupal.org/project/commons

sunset_bill’s picture

There are apparently several ways of doing multitenancy, but the one that looks most appropriate for Drupal is a shared schema strategy, where tenants use the same DB instance with their own schemas.  I haven't tried it yet, but it looks to me like using table name prefixes could work for this.  settings.php knows about $_SERVER, so this should work, at least for the DB side.  Routing is another matter...

switch ($_SERVER['SERVER_NAME']) {
  case 'site1':
    $prefix = 'site1_';
    break;
  case 'site2':
    $prefix = 'site2_';
    break;
}

$databases['default']['default'] = array (
  'database' => 'databasename',
  'username' => 'sqlusername',
  'password' => 'sqlpassword',
  'host' => 'localhost',
  'port' => '3306',
  'driver' => 'mysql',
  'prefix' => $prefix,
  'collation' => 'utf8mb4_general_ci',
);