God Speed with Headless CMS

Mimi Paul
Omnibuz
Published in
5 min readJun 18, 2019

Treading into starting our own software development company, our biggest hurdle was providing a common API for Content Managers and Developers.

Gone are the days when we spent a fortnight writing APIs for different devices, building code front-end templates over the API to serve mobile apps and websites. With this we got stuck during plugin installations, feature customizations, library upgrades, hotfixes, etc.

Photo by Marek Levak from Pexels

Bye Bye.. Coupled CMS

Coupled systems are good for basic websites, blogs, forums as everything can be managed in one place. But this means your Content Management System code is hardwired to any custom code and templates, which means we developers have to spend more time on installing, customizing, or upgrading the current system. Moving code to another CMS is another headache you will have to go through. We can’t be doing this every time some library gets updated or there is a change in Frontend. This is insane!

The Hero without a Head

A headless CMS is a back-end only CMS built as a content repository that makes content accessible or, rather acts as a content provider, via a RESTful API for displaying content on any device. Thus, the concept of chopping the “head” (frontend, i.e. the website or mobile app) off the “body” (backend, i.e. the content provider).

A headless CMS does not care about how and where your content is displayed. It focuses on storing and delivering structured content.

Tales of the Headless Hero

By 2025, our homes, transport and offices will host over 40 million IoT devices. Everything from the Alexa on our kitchen countertops, to Apple Watch on our wrists, to the screen-touting kiosks at the local mall. Serving all these devices, a business has to tread the omnichannel road the headless way.

Development with this Headless approach helped businesses,

  • To be Omnichannel Ready: Ready to serve multiple channels, including website, mobile app, digital assistant, virtual reality, smart watches, etc.
  • Lower Operational Overheads: Installations, upgradations and customizations got cheaper since we moved to serverless headless approach.
  • Promote Agility: Projects finished faster since, content managers and developers worked simultaneously.
  • Enable Polyglot programming: Multiple programming paradigms is used to deliver content to multiple channels, and enabling us to benefit from the latest developments in language frameworks, promoting a microservices architecture.
  • Scalable Cloud: The stateless APIs of headless CMSs enabled high scalability, especially as the architecture fully leverages the elasticity of a cloud platform.
  • System Security: Since the content is typically provided through a high-performance CDN service, the risk of distributed denial-of-service attacks (DDOS) is reduced.
© Omnibuz Labs

Leveraging our development with this approach

Our strategy to beat slow development was to build a platform with an n-layer microservice architecture with NodeJS. Our aim was to build an architecture which can serve any device with a single backend. Be it a website, mobile app, a VR device, a digital assistant, a remotely connected IoT device, or an Apple Watch.

n-layer Headless Microservice Architecture © Omnibuz Labs

Let’s talk about all the layers in this n-layer microservice architecture,

  1. The Database: You can select any SQL or NoSQL database for this layer based on your business scalability, community and data structure.
  2. Database Driver Library: This depends on the database you’re going to use in the first layer.
  3. Database Schema Manager: The schema definition of your data/information architecture is defined here. Schema definitions help you define data structures and objects reusable functions across the system.
  4. Database Operations Manager: In this layer, we define the operation like record insert, read, update, delete, batch CRUD operations, file uploads, data encryptions, file encryptions and data indexing.
  5. API Controller: This layer defines all the routes to different database operations, and defines routing params and links.
  6. API Authorization Middleware: The Authorisation middleware handles the Oauth 2.0 protocol to authorize websites, apps, and other frontend services, before giving limited access to content and data providers.
  7. API Rate Limiting Middleware: This layer maintains a rate at which the API service serves the HTTP Requests. If any device or service goes beyond the rate limit, they are instantly held back until the next slot for making requests.
  8. API Logger: Logs all HTTP requests from all devices and services for monitoring, automating api testing and maintenance.
  9. API Router: This layer focuses on API Routing conditions for different devices and content managers.
  10. CDN Service: A properly configured CDN helps protect websites against some common malicious attacks. Visitors experience faster api response times, lower latency. As users are more inclined to click away from a slow-loading site or a slower app, or a buggy Alexa Skill, a CDN can reduce bounce rates and increase the amount of time that people spend on the device with your Application.

The demand for this headless solution is nothing new, as businesses look to deliver content to locations outside of the standard web browser. Startups, small businesses and enterprises can take the headless plunge with confidence with some headless CMS solutions readily available, like Butter CMS, Contentful, dotCMS, GraphQL CMS, Strapi, etc. If you are looking for a custom solution and can invest time, effort, patience on building something that you are going to reuse for the next decade, a custom n-tier microservice architecture is the go-to modular scalable approach.

Wrapping Up

Any personal tips to share ? Don’t be shy and comment. If you still have any questions regarding the details of the architecture? Please put it there, and I’ll give my best to answer.

Thanks a lot for reading, have an uber day!

--

--

Mimi Paul
Omnibuz
Editor for

Founder @QuantumParadox.Studio, Coder — Blogger — Artist Currently working on apptodesign.com and yourpage.app. Helping Small Businesses & Creators grow & earn.