9th April 2017

How API-first content management solutions future-proof your content

Ronald Ashri
Technical Director
Paper plane

Decoupled websites, headless CMS, API-first CMS. These are all terms to describe approaches where the creation, storage and retrieval of content is decoupled from the presentation of content through the use of a (REST) API.

This decoupling presents a number of obvious benefits when thinking of building large complex applications where content creation needs to happen through a number of different and optimised interfaces.

Platforms that offer a compelling API-first approach include open source Drupal 8’s new features and closed source, SaaS platforms such as Contentful or Prismic.

There is a less explored question, however, of whether there are any benefits in building headless websites when we are dealing predominantly with just content presentation where doing rendering server-side and using the CMS’s template tools is a valid option.

An example of this would be one of the recent Deeson websites - the Robbie Williams site - where the front-end is built as a React.js application while the backend where content creation happens is through the standard Drupal admin interface.

What are the technical and business benefits on decoupling in such instances? Why not just build through a standard approach? Here we explore some of the benefits we found.

1. Content model discipline

Websites are built by people. People are error-prone. This is particularly relevant when it comes to content modeling.  Content modelling is the process of describing what bits of information need to come together to create a page and how they are related in terms of the domain they are describing.

If the front-end is tightly coupled to the backend we can easily fall in the trap of adding elements to our content model (specific fields, tags, etc) that are related to a specific presentation of that content. A typical example of this is creating content with fields named "left sidebar content" or “xmas header marketing promo - 2016". When we do this we are embedding into our content implementation specific information and potentially hidden assumptions that will come and haunt us during the next website redesign.

The correct way to introduce this sort of information is through a layer above the content model that maps our content model to specific short-term concerns regarding presentation.

Decoupling the process of thinking about content from the process of thinking about how content will be displayed allows us to create content models that are more likely to survive the test of time. This will then translate into a business benefit as subsequent website redesigns will not be as painful.

2. Write-once / display anywhere

The plethora of devices through which our content might be accessed means that we need the right kind of flexibility to built the best possible display of our content. Decoupling and content model discipline allow us to better achieve this. A CMS templating language cannot cater for all possible situations. It is constrained by an understanding of what "all possible situations" are that is, by definition, in the past. Being able to use the most suitable frontend model given context is highly beneficial and translates in more engagement with your content and ultimately your organisation.

3. Evolve front-end or back-end independently

The only constant is change. Yes, it is the most overused phrase in technology but that is because it is true. Building in our solutions clear interfaces that allow us to better deal with change is very beneficial. Separating display from content creation and administration allows the two to evolve independently and (within reason) enables us to completely switch out technologies used on each layer.

4. Delight our users

One of the benefits of using frameworks such as Angular or React for building front-end interfaces is that we can delight our users with sophisticated interactions that span the journey across the site in a way that is simply not possible with more traditional server-side technologies. These interactions can give the site a character and personality that is just as important as the colours, typography or other forms of branding. It is of course, important to be able to degrade gracefully where such interactions would be detrimental to the user experience (e.g. for accessibility reasons).

5. Delight our developers

Ask anybody in the Drupal world about the PHP-based template engines and you will get inevitable groans caused by the memories of using such developer unfriendly tools. Front-end developers want to use the best tools for the job and CMSs that constrain them to use old and ill-fitting tools decrease efficiency and even worse decrease creativity. Flexibility in choosing the best tool or language is not only a better way of doing things, it also provides the spark and motivation to do things better (see point 1 about humans again).

The web is changing. It is morphing into a far more complex tangle of devices and ways to access information. Websites are no longer just websites. Content is king. We need to start using technologies that free our content to be presented in the best way possible.  API-first solutions are currently the best way to achieve that.

Find out more about our open source content management system services