Monthly Archives: October 2008

Drupal Enterprise how-to

In a couple of earlier posts I mentioned how I thought Drupal could be used as an enterprise-level CMS, at least if you were willing to change modify your definition of ‘enterprise-level’ slightly.

When thinking about deploying any CMS across a large organisation or large company, one of the things you’re going to find is that you need two key things:

  1. separate departments will want separate sites that they can control the content of, and maybe even the look-and-feel of
  2. content from all those departments will need to be aggregated in some way, and reused by other departments

It’s these requirements that enterprise-level CMS cater for really well. It’s these that Drupal can only partially answer. This is why Drupal isn’t really completely enterprise ready, yet.

However it can go a long way towards that using its little-known but powerful multi-site capability. There are plenty of blogs detailing how you can do this in any number of ways, so I won’t go into details here.

Take a look at some of my delicious bookmarks for things I found really helpful in setting up a multi-site system.

Basically, the idea is that each site in your multi-site setup has its own folder in Drupal’s sites/ folder. Something like www.mydomain.com.site1 would do. Now you have one Drupal installation, but the potential for lots of separate drupal sites.

While that does cater for a really simple single codebase setup, it doesn’t let you share things like users and logins. That’s going to be crucial for any true multisite setup, because you’ll want the same user to be able to go to different parts of your overall website without having to log in to each separately.

Luckily, Drupal has a really elegant solution to this. You can easily share tables across sites using Drupal’s database prefix system. So for example you could say that site1 will have its own tables prefixed with site1_ except it will use the user table of site2 (identified by site2_) for its user data.

This is all set in each site’s settings.php file, and requires just a few lines of code to do. Simple.

And with that, you open up a whole new world of multiple sites with single signons: the first step to an enterprise-level solution.

OK, so you don’t have truly shared content across sites yet. You may never have that, but then you may never need that. RSS feeds, simple RESTful APIs… there are all sorts of other ways of sharing content. You could even get adventurous and write your own module that treats some kinds of content types differently, putting them in shared tables rather than a site’s own set of tables.

Hooked into Drupal

In my last blog I mentioned how Drupal really does seem to offer more than just the ability to get a simple site up and running quickly.

Framework

When you look at Drupal more closely you realise one key thing: it’s not really a CMS, it’s a framework. Granted, nothing quite like Symfony in terms of its level of sophistication, but a framework nonetheless. Even a fairly modest PHP developer can therefore take what’s there and build on it in quite surprising ways. The vast array of Drupal modules is testament to that.

Hooks

That’s what makes Drupal so alluring as a CMS. It’s founded on a system of hooks: naming conventions which ensure that pieces of code you write will get called in certain pre-defined situations.

The simplest example of a hook is the menu hook. If you build your own module, all you need do is put a function in it called mymodule_menu and whatever code you put in that function will get called each time the core code builds the main site menu.

The real elegance of the system is that almost everything is built from hooks. Even stuff which looks like it’s part of the core code, like user management. Well, that’s actually a module built up using hooks. If you want to build your own slightly different user module, you don’t need to change the existing one. Just copy it, taking out the bits you need, adding in your own bits. Before you know it, you’ve got your own custom user module.

Community

The learning curve can be a little daunting at first, assuming you want to get your hands dirty with some module coding. Luckily, there are loads of excellent books (I can definitely recommend Pro Drupal Development by John VanDyk), web pages, blogs, etc around to help. Just google them, they’re out there! That’s another great strength of Drupal: the community. No matter how stuck you are, how bad things look. Chances are there’s someone out there who’s been in exactly your situation and come out the other end.

Drupal as an enterprise CMS?

 

drupal

I’ve been looking a lot recently at Drupal not just as an open source CMS, but as a viable enterprise level CMS. Despite my earlier misgivings I think Drupal has a lot going for it, and it may be that over the next couple of years it will become a much bigger force in the world of content management.

Months of searching for a really good open source CMS had never really come up with anything that would meet my needs:

 

  1. free/cheap
  2. really easy for people to create and edit content
  3. great support, or at least a great user community I could turn to
  4. highly extendable by someone with sufficient coding expertise
  5. able to cope with lots of separate – but related – sites from just one installation

My first thought was Drupal. So simple, so lovely… but… but that’s just for small companies and society websites, right? OK, next!

Then I found MySource Matrix (developed by Squiz, an Australian company) which did everything except point 2 (and sort of failed on points 3 and 4, but that’s another story). Then I found Alfresco, which is really a document management system. As you’d expect, it did everything except point 2 because for it, web pages are just another form of document.

I was running out of ideas. But actually, after I was forced to think about the total lack of open source enterprise CMS, I started to wonder whether I really needed all 5 of the above. Maybe I just needed the first 4, and having a massively integrated multi-site system is something which I could live without.

Hoorah! Epiphany! Yes, Drupal does do everything I want. As soon as you start to realise that, Drupal seems to fit the bill perfectly.

Even better, the more I looked at multi-site capabilities, the more I saw how Drupal does allow for this, albeit in a somewhat limited way compared with the really big, expensive commercial CMS. Don’t believe people when they say that Drupal can only do small sites. It can do far more than that. With a little imagination and tinkering around it can actually do a vast amount.

Delving deeper… I saw that there are now companies offering enterprise level SLAs for Drupal. Specifically, I found Acquia. It’s a company set up by the founder of Drupal himself – Dries Buytaert – to offer the kind of hand-holding that’s put people off Drupal in the past. OK, it’s a very new company with no track record. But the signs are good.

I think the moral to this story is: make sure you know what you’re looking for from a CMS. Don’t just assume you need the most expensive powerful beast out there. Don’t even assume you need something that fits in exactly with your organisational needs. Chances are that in most situations, your needs aren’t quite so written in stone as you might think.