Leveraging a common Drupal codebase to power multiple Drupal sites provides compelling benefits, including faster site launches, reduced maintenance overhead, and centralized security updating.
However, in order to be successful and avoid typical traps, the use of a common Drupal codebase requires some extra design care and strategy.
At Acquia, we’ve developed a set of best practices for developing a codebase that is intended to power multiple sites on the Acquia Cloud Site Factory platform. Below, I answer some questions about the strategies we have employed to create a codebase that can power hundreds or thousands of Drupal sites.
How should a Drupal developer create a core Acquia Cloud Site Factory (ACSF) distribution for multiple site delivery and operations?
Developing a platform on ACSF is very similar to developing a multisite platform outside of ACSF. The biggest challenge is setting up a governance and development strategy which allows for customization of individual sites within the platform while preserving the updatability of the platform code.
What’s the best development environment to deliver an ACSF distribution?
In Acquia Professional Services we start all builds using our BLT framework (https://github.com/acquia/blt). This ensures consistent tooling and delivery. Within that framework we use DrupalVM (http://www.drupalvm.com/) for local development and begin each build using Acquia’s Lightning distribution (https://github.com/acquia/lightning).
During the build phase of a project we build an install profile which when installed will give all of the tools and building blocks for creating an individual site within your platform.
How do you extend ACSF Drupal modules and themes?
Within our platform we include a base front-facing theme which will give a consistent basis for all of the site specific sub-themes to extend. When theming an individual site the base front-facing theme allows for all common layouts and styles to be incorporated into all of the sites within the platform (unless overriden by an individual site).
What are the major differences between developing a codebase for one site versus many sites?
When building a platform it is important to think of the blocks, views, and content structures of a platform as an API to the front-end theme layer. If you ensure that the platform delivers all of the necessary variables to the front-end templates then individual sites can theme those variables in different ways without needing to update or vary the underlying platform code.
How do you choose modules when different sites that will run on the platform have different needs?
This takes coordination between the business and tech leadership on the project. Both teams need to be on the same page when it comes to the expected and desired features of the platform. When a new feature is proposed by the business the tech leadership needs to evaluate and decide how best to incorporate the feature without jeopardizing the existing sites on the platform. At times this will require negotiation and compromise.
If you are starting a brand new ACSF development effort, what steps do you need to take to make sure things go well?
Ensure that both the business and the technology teams have a strong plan in place for the direction of the platform. The architectural plan needs to take into account the planned direction of the platform within the initial 1.0 phase and put into place a platform which can be built upon for future phases.