Home / Blog / Why Use Decoupled Drupal

Why Use Decoupled Drupal

Decoupled Drupal, also known as Headless Drupal, is the practice of using Drupal as a back-end content repository with at least one non-Drupal front-end. When using this approach, Drupal exposes APIs that you can use in a mobile app, a single-page JavaScript-driven app, or any other front-end. Websites have used Drupal this way for years, but the increasing prevalence of mobile apps and maturity of JavaScript frameworks has contributed to increasing interest in Decoupled Drupal. Drupal 8 also makes the API-first approach easier than ever with RESTful services in core.

When should you build Decoupled Drupal websites?

  • Your front-end team is deeply familiar with non-Drupal technologies and is struggling with Drupal’s theming layer (although Drupal 8 improves the theming layer with the adoption of the Twig templating engine)
  • Your front-end team really wants to use new technologies designed for easy DOM manipulation and AJAX integration
  • You need a front-end in a non-browser context, e.g. a “native” mobile app
  • You need broad cross-channel flexibility, you might want a Drupal front-end as well as alternative front-ends like mobile apps
  • You have a mixture of real-time content sources, for example a weather or news site that pulls dynamic data from web services to layer on top of more “evergreen” content

However, there are several drawbacks because using non-Drupal front-ends means you lose native Drupal functionality:

  • Site builders may have more difficulty changing the content model or presentation quickly because any changes have to be re-implemented in the alternative front-end
  • Drupal can no longer build, validate, and process your forms automatically (and developers need to think about how they manage these processes on the front-end and back-end)
  • If you deploy new modules, you may have to re-implement their front-end functionality
  • Content creators will not be able to preview what content looks like once it goes to production, unless you specifically build a preview pipeline

There are other advantages and disadvantages to the Decoupled Drupal approach as well. For example, JavaScript-driven UIs can feel snappier due to the lack of page reloads, and while delivering this experience in Drupal is possible it can be easier with a decoupled front-end. Additionally, you also have to decide whether the financial and timeline cost of building your own front-end instead of theming Drupal is a worthwhile tradeoff. Ultimately, Decoupled Drupal is the right choice for some sites and use cases and not others. One size does not fit all.

Acquia Cloud customers run many sites and applications using Drupal as a back-end content repository. Some of those sites run in a Virtual Private Cloud. This allows the content repository to access sensitive in-house data without exposing it to the broader internet. Then Drupal can selectively expose information via APIs to different channels. Acquia also runs some of its internal applications on Drupal in a decoupled architecture. If you’d like to learn more about how to pick the right approach for you, feel free to reach out and contact us.

This post was written with contributions from both Christian Yates and Isaac Sukin.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

Filtered HTML

  • Use [acphone_sales], [acphone_sales_text], [acphone_support], [acphone_international], [acphone_devcloud], [acphone_extra1] and [acphone_extra2] as placeholders for Acquia phone numbers. Add class "acquia-phones-link" to wrapper element to make number a link.
  • To post pieces of code, surround them with <code>...</code> tags. For PHP code, you can use <?php ... ?>, which will also colour it based on syntax.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <h4> <h5> <h2> <img>
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.