Stefan Baumgartner is a software architect based in Austria. He has published online since the late 1990s, writing for Manning, slots empire bonus codes
Magazine, and A List …
Weekly tips on front-end & UX. Trusted by 176.000 folks.
Quick summary ↬
When deploying websites, there’s rarely a one-size-fits-all solution. Some websites benefit from server-rendered pages, some prefer statically generating content upfront. In this article, Stefan explains how a CMS such as Storyblok can help you make your site more resilient without losing the flexibility to deliver time-relevant content.
This article has been kindly supported by our dear friends at Storyblok, a friendly headless CMS with a visual editor, nested components, and customizable content blocks for websites and apps. Thank you!
In the last couple of years, our industry has figured out how to make use of cloud infrastructure and flexible deployments in the best way possible. We use services that give us continuous integration without headaches and serve static files without us managing anything. And adding the right framework to the mix, those services blur the line between static files, dynamic updates, and serverless APIs.
In all of this, one fundamental piece is often left out: storing data. This raises the question, “Where does our content come from?” Well, a headless content management system might just be what you need.
The Mighty Monolith And Opinions
In order to understand why we get so many benefits out of architectures that involve headless systems, we need to understand how things worked with a more traditional approach: monolithic architectures.
Not so long ago, monolithic content management systems were the jack-of-all-trades for your web content delivery concerns. They came along with:
a database (or required a very specific one),
the logic to read, change, and store data,
user interfaces for content administration,
logic to render all your content in deliverable formats such as HTML or JSON,
the ability to upload, store, and deliver assets like images and static files,
sometimes even an editor for design,
a routing logic to map readable URLs to actual data in your system.
That’s a lot of tasks! Furthermore, a monolithic CMS more often than not was very opinionated in its choice of tools and flavors. For example, if you were lucky, you got a template engine to define the markup you wanted to produce and had absolute control over it. It might not have been as featureful as you wanted it to be, but it at least was better than mixing PHP code with HTML tags.
Being this opinionated left you as a developer with two choices:
Submit to the system. Learn all its intricacies inside out, become an expert, and don’t deviate from the standard. Treat a CMS as a framework with all the benefits and downsides that come with them. Be super productive if you follow the rules. Avoid anything that doesn’t play well with the opinions of your tool of choice. This can go well for a long time. But you become very inflexible if there are changes in requirements. Not only if you need a different front-end to deploy that is to be designed differently than your tool allows, but also if you end up needing to scale out your servers because of increased traffic, or you need to establish stricter security because of slots empire bonus codes attack vectors you can’t mitigate. Don’t get me wrong, people who produce and develop monolithic CMS know about those challenges and work on them. It’s still not your choice if you want change.
Work around the system. This is arguably worse than following a framework blindly. If you work around a system, try to integrate functionality via plug-ins, shift responsibility to attached systems on the side, try to hack something in the core to get things done your way (yes, this happens as well), you end up frankensteining your solution until it’s unrecognizable anymore. While this gives you flexibility when your product managers want to crank out features, it will fall back on you sometime in the future. Don’t do this.
None of these choices is something we want to have. And it all happens because we mix responsibilities in one single solution: How we define, maintain, and store content is mixed with the creation of views.
The following chart shows what happens if we want to see content produced by a traditional, server-side rendered system.
A client, maybe a browser, requests a website from a server via a URL;
A router resolves the URL and maps it to some input parameters that the system can understand;
It asks a rendering component to render content based on said input parameters;
Then, in return, it needs to ask the data storage if this content is available;
One pierce through the layer cake, and you get your content back;
The renderer renders it into HTML;
The routing layer can send a response to the client.
Every communication between the components of this layered architecture is subject to the opinions of its creator. In monolithic architectures, these are the content management system’s opinions. If you want to change them, you have to go the extra mile.
The Promise Of Headless Architectures
And this is exactly where headless content management systems come in. A headless CMS gives you easy reading access to the data. Everything else can be designed according to your opinions.
You decide how to resolve routing. On the client? On a web proxy? In a Node.js server? Your choice. You decide how and where to render content. Again, on the client? With blade templates in PHP on the server? A serverless function on AWS Lambda written in Go that spits out JSON? Your choice.