Skip to main content

How does headless Drupal work

2021-01-25

Headless Drupal, has been utilized in many applications. In this article, we will go through the details of decoupled Drupal, discuss both the advantages and disadvantages of using headless Drupal and talk about who should consider working with headless Drupal.

Headless Drupal vs decoupled Drupal

A lot of people use these two terms interchangeably and for the most part, it does mean the same thing. But there is a slight difference. To determine whether the application is using headless Drupal or decoupled Drupal, you have to know how the API is being used. Decoupled means that the frontend presentation and the backend are separated and the API plays the role of communication between the front and back.

On the other hand, headless Drupal means that it does not have a frontend to work with, but only an API-driven content repository. This means that it can have a variety of “heads” and flexible to be distributed or presented where you need it to be. For this article, we will use the term decoupled but just note that although sharing the same concept, there is a technicality difference between the two terms.

Traditional Drupal vs decoupled Drupal

A traditional Drupal website, such as the one you are viewing right now, uses Drupal to take care of both the back-end content management as well as the font-end rendering of content. Drupal is an all-in-one solution for many applications, it is already versatile and flexible for being compatible with different devices, managing multi-site or multi-language sites, as well as the scalability of websites. But as phone applications, social media and interactive features became more popular, occasionally, the frontend, meaning the content consuming portion of the website or web application, needs to be more interactive and more immersive than a traditional Drupal front-end can offer. This is where decoupled Drupal can be a great fit.

In a decoupled Drupal architecture, instead of using Drupal’s theme layer, it only uses the back-end of Drupal for content management, while building a front-end with AngularJS, React or other frameworks for the users to consume the content. A good example we’d like to use is a car review website. Imagine a traditional car review website but also has a chatbot to narrow down what cars are available for you in your neighbourhood depending on your needs and book a test drive at a dealership and also shows you the inventory of both new and pre-owned cars in that dealership. Once you head to the dealership, there is a kiosk at the front door for you to check-in and scan your drivers’ licence. This would be a good project to utilize decoupled Drupal. Check out the list of websites that are using decoupled Drupal.

Advantage

In simple terms, the advantage of using decoupled Drupal is it gives you a lot of room for new technologies on your website. Here are some examples of the advantages of decoupled Drupal.

User Experiences

The capabilities of user experience may be the best advantage of decoupled Drupal. You can implement interactive applications, and do custom designs for different devices and interfaces. Because of the front-end being somewhat detached from the backend, the performance and speed can be drastically improved, this will not only impact the SEO of your website but also improve the UX.

Development Efficiencies

Developing a traditional Drupal site sometimes runs into issues of front-end development that are hamstrung by the backend development, and sometimes vice-versa. Full-stack developers that can take care of the entire project are often high in demand and harder to find. By separating the frontend and backend, developers can focus on their expertise and work simultaneously without blocking one another. Teams with different skill sets can work separately but “together” at the same time. If the project is well-managed, often times the end result is much better in terms of future-proofing, best practices for easier debug and update, compared to relying on one team to build the backend and frontend.

Keeping it fresh

For many companies, maintaining a fresh and modern looking website is important. These companies have to go through a re-design every few years or so. When the front-end is separated from the back-end as a decoupled Drupal site is, the overall cost of the website re-design often turn out to be lower than if the entire website is run on Drupal.

Disadvantages

No technology is all good and zero downsides. There are many reasons why decoupled Drupal is not the way to go for your website. Here are some examples.

Initial Cost

One reason Drupal is one of the best CMS on the market is due to the features and functionality out-of-the-box. For many projects, it is the fastest and most economical solution. However, when we are separating frontend and backend you would need to hire two teams with expertise from both sides, and even though this doesn’t mean doubling the cost, it could be significantly more costly compare to a traditional Drupal website.

Maintaining the site will also cost more than traditional Drupal websites simply because there are two aspects to maintain and service. Although as mentioned above, you might be able to offset some of the cost down the road when you need a start a refresh or re-design project.

Project management costs may also be greater than traditional projects. Making sure the two teams working separately are communicating well throughout the project requires a lot of planning and skillful management.

Security

Drupal is known for its security to compare to other CMS out on the market. Besides the dedicated security team working on security patches, out of the box, Drupal offers form validation and text sanitization for all form fields. This protects the website from cross-site scripting attacks. But when it comes to decoupled Drupal, the front-end implementation needs to account for the risk when developing. When security patches are needed, instead of one implementation, it would need extra implementation effort to account for both the frontend and the backend of the website.

Expertise

Echoing from the initial cost being higher than traditional Drupal sites, decoupled Drupal is something fairly custom and it is harder to find developers who have done this before. Online help for people sharing their previous experience on this matter would be relatively limited compared to other applications. This combined with the extra effort needed from custom modules to multilingual support will mean that there might be challenges finding the right developers and translates to longer development time and expensive initial cost.

Who should use decoupled Drupal?

After going through both the advantage and disadvantages of decoupled Drupal, it is clear that they are not independent, the advantages often come with some side effects that might cause some trouble while in development. But with proper management and the right development team, decoupled Drupal can be a very successful, high performance, user-friendly application. But it is not for everyone.

Drupal on its own is powerful, flexible and versatile. Especially at the backend content management. To let other systems manage the frontend while Drupal takes care of the backend is a very specific usage of Drupal and you should only consider it when you want to adopt the top of the line modern frontend technologies that Drupal cannot provide. If you need interactive features, real-time live chat support, or if the content needs to be consumed in multiple platforms and devices that Drupal might have a hard time supporting.

Who should not consider decoupled Drupal?

Although decoupled Drupal can be very powerful, it might not be a good fit for everyone. In fact, most websites on the world wide web probably don’t need decoupled Drupal websites. News sites, blogs, brochure websites, websites for small businesses, and any website that doesn’t really need too much user interactivity or is consumed by users on desktop and mobile browsers will not benefit from decoupling their Drupal website. It will also increase the development cost.

Summary

Headless Drupal or decoupled Drupal is a relatively new approach to build websites with interactive features. If you have the right developers and the right management, it has the potential to be very powerful for content consumption on different platforms and devices. Plan out your next project and see if decoupled Drupal is right for you. If you have any questions about whether your goal can or should be achieved with decoupled Drupal, feel free to give us a shout and we will be more than happy to assist with your needs.

Headless Drupal Decoupled Drupal Drupal Frontend