Many Drupals – Separate sites – Multi-site



Many Drupals – Separate sites – Multi-site

3 1


slides-multiheaded-drupal


On Github palantirnet / slides-multiheaded-drupal

Multi-Headed Drupal

Presented by Larry Garfield (@Crell)

@Crell

  • Senior Architect, Palantir.net
  • Drupal 8 Web Services Lead
  • Drupal Representative, PHP-FIG
  • Advisor, Drupal Association
  • Loveable pedant

Stop me if you've heard this one...

Drupal University

  • 30 Colleges
  • 40 Departments each
  • Over-worked IT department wants centralization
  • Departments want to be special snowflakes

How can we square that circle?

  • Lots of options
  • Goal: Confuse you with options, unconfuse with guidelines

Not rules, more like guidelines

Separate sites

Separate sites

  • Never mind, KISS
  • Give everyone their own Drupal

Separate sites

Benefits

  • Standard platform
  • No added complexity
  • Complete freedom for each implementation
  • Mixed Drupal versions

Drawbacks

  • No economy of scale
  • No (intrinsic) standardization
  • Many sites to have to manage
  • Don't overlook this option

Features.module

  • Dump configuration to code
  • Packages of functionality
  • Easily distributable (Sometimes)

At least until Drupal 8...

  • Deploy new functionality to many sites, new features module
  • Deploy, enable, done.
  • Not always viable; needs to be discrete functionality

Install profiles

  • Since Drupal 5
  • Quasi-modules in Drupal 7
  • All the power of a module...
  • ... plus install wizards
    • Create content types
    • Create content
    • Create roles
    • Create users
    • Set config variables
    • ... Do anything that has an API

Install profiles

+

Features

=

Distributions

Distributions

  • A web application built with Drupal
  • Examples:
    • Open Atrium
    • Drupal Commons
    • OpenScholar
    • Conference Organizing Distribution (COD)
    • Open Academy
    • Panopoly
    • Your custom distribution here

Many many more...

  • Usually NOT extensible

Example

DEIMS

  • Drupal Ecological Information Management System
  • International Long-Term Ecological Research Network (ILTER)
  • Data collection site-in-a-box
    • Local team data
    • XML feeds to share data
    • No inter-dependence
  • focused on long-term, site-based research and monitoring.
  • Member stations world-wide record gigabytes of data each year.
  • Unrelated organizations can add instance on their own.

Multi-site

  • Drupal feature since at least 4.5
  • One code base, many sites
  • "Separate sites with shared code"

Multi-site

/
  sites/
    default/
      settings.php
    www.drupal.edu/
      settings.php
    biology.drupal.edu/
      settings.php

sites/sites.php

$sites['www.drupal.edu'] = 'main';

$sites['fapi.api.drupal.edu'] = 'fapi';

$sites['multisite.building.drupal.edu'] = 'multisite';

$sites['fundraising.drupalassociation.com'] = 'da_fundraising';
/
  sites/
    sites.php
    default/
      settings.php
    www.drupal.edu/
      settings.php
    fapi/
      settings.php
    da_fundraising/
      settings.php

Multi-site

Benefits

  • Separate Sites, plus...
  • One codebase to update
  • Lower memory overhead
  • Table sharing (don't do that!)

Drawbacks

  • Separate Sites, plus...
  • Only one core version
  • Multiple module versions are hard

If you have one server admin team...

... use Multi-site

If you have many server admin teams...

... use Separate sites

Modern deployment practices mitigate the first

Example

University of Minnesota

  • ~15 Installs
  • Many sites per install
  • 100s total
  • 2 install profiles
  • No features updates
  • Can have custom themes
  • Few code bases = 15 pushes for sec updates
  • Multiple multi-sites
  • Custom management logic around each site (complex)

You probably don't meanmultiple sites anyway...

  • You keep using that word...
  • Probably mean site sections/clusters/divisions
  • Lots of options for one "site", many areas

Domain Access

Domain Access

  • Access Control module
  • Node grants (here be dragons)
  • Domain == subsite
  • Affects node view
  • Suite of modules

Domain Access: Basics

Domain Access: Basics

Domain Access: Settings overrides

Domain Access: Themes

Domain Access: Themes

Domain Access: Timezones

Domain Access: Node editing

Domain Access: Node editing

Domain Access: Node editing

Domain Access

Benefits

  • One site to manage
  • Content sharing
  • Per-domain theme
  • Some per-domain config
  • Consistent architecture

Drawbacks

  • Consistent architecture
  • Must use multiple domains
  • Uses node access
  • Single point of failure
  • Scales to low-tens
  • Everything gets a little bit more complicated...

Example

Interlochen Center for the Arts

  • One instance, ~6 domains
  • Shared theme w/ color tweaks
  • Easy content sharing
  • Art school / summer camp / public radio station
  • Was D6, we moved to D7
  • Left off radio station; domains easy to split

Organic Groups

Organic Groups

  • Rewritten for Drupal 7
  • Any entity == "group"
  • Any entity belongs to a "group"
  • Users join groups
  • Think Google Groups, Yahoo Groups
  • Groups.Drupal.org
  • Think bigger than that

Organic Groups

Access control

  • Per-group Roles
  • Per-group user membership
  • Per group node/field edit/delete permissions

Organic Groups

Integration

  • Views plugins: Included
  • Ctools/Panels Context plugins: Simple
  • Very good Chaos suite integration

Organic Groups

Group nodes

Organic Groups

Permissions

Organic Groups

Benefits

  • One site to manage
  • Content sharing
  • Per-group theme
  • Scales to thousands
  • Only one domain
  • Consistent architecture

Drawbacks

  • Consistent architecture
  • Only one domain
  • Still site-wide settings
  • Single point of failure
  • Everything gets a little bit more complicated...

Example

California State University Northridge

  • College or Dept = Group
    • Group node has settings
    • Lots of Entity Reference
  • Separate roles per dept
  • Panels Ev. / Panelizer
  • Very similar themes
  • 40k students
  • Wanted one single site, period
  • Settings on group node hidden, eg default slideshow
  • Drag-drop customizable, mostly

Do you even need multiple "sites"?

Just because it's different sites now doesn't mean it must be

Just because you call it a "site" doesn't mean it is

What does "site" even mean?

  • Answer depends on who you ask
  • Perspective

What does "site" mean?

  • A presence on the web
  • An organization's home page
  • A path root
  • "What I have access to"
  • For content editors, it means the last one

Single-site

Access control

Workbench Access

  • Divide site into administrative sections
  • Sections != path (unless you want it to be)
  • Assign roles or users to sections
  • Affects edit, not view

Variable themes

  • Panels: Layout tool
  • Panels Everywhere: Layout for page tpl, can vary on context

Single site

Benefits

  • No/little mental overhead
  • One code base to manage
  • Easy on the server admin and site-admin

Drawbacks

  • Limited variability between "sites"
  • Public understands only a single "site"
  • Single navigation hierarchy
  • Your Org chart is not your IA

Example

Mt. Holyoke College

  • Many departments, centrally managed
  • Workbench access
  • ThemeKey for (some) theme switching

Mix and Match

Multi-site can host any combination of sites

  • Multi-site / OG
  • Multi-site / Domain Access
  • Multi-site / Workbench Access
  • Multi-site / Domain Access / OG

Example

Barnard College

  • 50 departments
  • One site with Domain Access
  • ... and Workbench Access for edit control
  • Every department its own Domain
  • WB Access for splitting editing

Decisions decisions...

If you want... Probably means... Multiple core versions Separate installs Different content types Separate installs, multi-site Single user base Domain Access, OG, Single-site Subdomains Separate installs, multi-site, Domain Access One domain OG, Single-site Simplified server admin Domain Access, OG, Single-site Shared content Domain Access, OG, Single-site Per-department ACL Single-site, OG Department autonomy Separate installs, multi-site (less so OG) Per-department Views Separate installs, multi-site (less so OG) Staggered migration Separate installs, multi-site, Domain Access, proxy server? Per department theme Separate installs, Multi-site, Domain Access, OG Inexperienced site admins Separate installs, Single-site

Remember: guidelines

Larry Garfield

Palantir.net

Let's make something good together

Keep tabs on our work at @Palantir

For more information