Decoupled Applications and Composable Web Architectures
Decoupled Applications and Composable Web Architectures
We are excited to present to you the report “Decoupled Applications and Composable Web Architectures,”
commissioned by Storyblok, a content management system (CMS) that empowers all teams to create
and scale modern content experiences across any digital channel.
Many of our customers love us for our visual editor, enabling their marketing teams to create and publish
content independently without having to talk to a product owner or create Jira tickets. Others for our
custom workflows and native collaboration capabilities that enable their teams to work together faster
on a single CMS. For us however, It all starts with composable architecture.
From our conception in 2017, we knew Storyblok had to be cloud-native, API-first, and composable. We
believe these are core qualities every modern tech stack must have in order to give developers the flexi-
bility to build great user experiences at scale while keeping up with fast-paced digital innovations.
In 2023, the need for flexibility, speed, and resilience in web development has become paramount.
Companies that can deliver standout content experiences faster, develop more efficiently and enjoy a
significant advantage over their peers. Those who don’t will face increased maintenance costs and slow
time-to-market as personalization and omnichannel strategies become increasingly complex.
We are proud to have been the only CMS recognized as the Customers’ Choice in Gartner’s Peer Insights
2023 report for web content management, validating our dedication to excellence. We are grateful to our
customers, partners, and community members who’ve consistently named us as a CMS category leader
on G2. However, the number we are most proud of is this: 582%.
That is the typical return on investment of a Storyblok customer over three years, as estimated by
Forrester Consulting whom Storyblok commissioned to estimate its potential impact on existing and
future customers using their Total Economic Impact™ (TEI) methodology.
One of the main factors contributing to this incredible return on investment is the efficiency and flexi-
bility provided to companies that build off our composable architecture. We’ve seen firsthand how our
customers like Oatly, T-Mobile, and Marc O’Polo have significantly improved their deployment speeds,
reduced development and maintenance costs, and boosted engagement with exceptional content expe-
riences built and scaled through headless architecture. Composable architecture doesn’t just transform
content and web applications. It drives business. Visit us at Storyblok.com to see for yourself.
As a company dedicated to empowering developers and technical practitioners with the transformative
power of composable architecture, we believe this report holds immense value for you.
Sincerely,
Dominik Angerer
CEO Storyblok
Decoupled Applications
and Composable Web
Architectures
Building for Resilience, Flexibility,
and Immediacy
Stefan Baumgartner
The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Decoupled Appli‐
cations and Composable Web Architectures, the cover image, and related trade dress
are trademarks of O’Reilly Media, Inc.
The views expressed in this work are those of the author and do not represent the
publisher’s views. While the publisher and the author have used good faith efforts
to ensure that the information and instructions contained in this work are accurate,
the publisher and the author disclaim all responsibility for errors or omissions,
including without limitation responsibility for damages resulting from the use of
or reliance on this work. Use of the information and instructions contained in this
work is at your own risk. If any code samples or other technology this work contains
or describes is subject to open source licenses or the intellectual property rights of
others, it is your responsibility to ensure that your use thereof complies with such
licenses and/or rights.
This work is part of a collaboration between O’Reilly and Storyblok. See our state‐
ment of editorial independence.
978-1-098-15144-7
[LSI]
Table of Contents
iii
CHAPTER 1
Composable Web Architectures
1
programming languages, frameworks, or tools for different parts of
the application.
In this chapter, we will look at the benefits and trade-offs of compos‐
able web applications at large. We do so by dissecting the traditional
monolith, and composing the remaining features in the frontend. In
doing so, we discuss the trade-offs of “rolling your own” as opposed
to using established vendors, and how integration with existing sys‐
tems can work. After reading through this chapter, you will be able
to migrate from your monolith to a composable web architecture,
no matter what your original setup looked like.1
1 For more radical, almost unapologetic takes on composable web architectures, check
out Jamstack and MACH.
To connect the application backend with the CMS, the CMS exposes
a set of APIs, usually in the form of JSON-based HTTP endpoints.
We call CMSs that use JSON APIs as their main output headless
content management systems.
In a headless CMS architecture, the CMS is separated from the
frontend website or application. The CMS only provides an API
for accessing the content, while the website or application retrieves
content from the API and renders it dynamically. You could say that
the JSON API becomes the frontend of the CMS, nothing more.
The routing unit’s only task is to map URLs to the right content,
reducing the critical path to a minimum. Push architectures are
easily deployed, cost-effective, and stable. The content is already
finished, and there are no issues with problematic queries or pro‐
gramming errors. Push architectures need to know all eventualities
up front, which means they lack significant support for dynamic
content. Approaches like Jamstack2 move dynamic, asynchronous
content to the client side, which is a reasonable solution, but comes
with different trade-offs, like a flash of unstyled content in client-
side rendering, increased programming effort on the client side,
unpredictable execution environments (browsers), and problems
when dealing with sensitive content.
2 See Modern Web Development on the JAMstack by Mathias Bilman and Phil Hawks‐
worth (O’Reilly, 2019).
The underlying systems stay the same, stay self-contained, and fol‐
low a single purpose. Finally, we have arrived at the point where our
application has become truly composable. Depending on our choice
of technology or vendor, we are able to choose the best way possible
for getting data to the frontend.
Conclusion
Every step toward composable web architectures shown in this
chapter gears toward one common goal: independence and compo‐
sition. Instead of having everything in one rigid, hard-to-maintain
monolith, developers can pick their favorite technology and develop
new features entirely independent from all other pieces of their sys‐
tem. This allows developers to ship new features fast, even dropping
the backend implementation in favor of a new third-party service
that might just do what they need. You compose your website from
different bits and pieces, creating a single representation.
This also allows organizations to move away from certain features
quickly. If a tool or service doesn’t seem to cut it, drop it in favor
of a new or better one. Technology lock-in becomes a thing of the
past; so does the big bang rewrite. The frontend layer just becomes
another piece of the puzzle, and UI rewrites don’t sacrifice the
architecture underneath.
In the following chapter we look at the implementation of composa‐
ble web architectures in detail, and deal with the operational impact
of such architectures.
Conclusion | 17
CHAPTER 2
Developing and Operating
Decoupled Applications
19
It includes the main website, using a custom rendering service con‐
nected to a headless CMS, a traditional blog monolith, a documen‐
tation website that is generated with a static site generator, and the
careers portal, which is a Next.js app getting data from a recruitment
portal. Next to it is a global search service that gets data from
various sources.
1. The main website served under the root /. This outlet contains
the main product and company information, and is highly opti‐
mized SEO content created by the online marketing team. They
use dynamic server-side rendering written in PHP, with content
coming as JSON via a headless CMS.
2. The company’s blog is served under /blog/ and is based on
monolithic blogging software that has been with the company
for a decade. The content is maintained by the e-marketing
team but contributed by the entire company. Allowing every
person in the company to write articles and keeping every con‐
tributor’s author biography are key features of this installation.
Figure 2-2. The traditional use case and approach for BFF, creating
tailored API layers for different user interfaces
BFFs and mesh layers also help with avoiding vendor lock-in. They
serve as the mediator between connected services and your applica‐
tion. Should you decide to change one service for the other, you only
need to adapt the BFF layer.
The big benefit from this setup is that if an error occurs, and the
function execution breaks the process, all other processes still run
and produce results. With this, software becomes much more resil‐
ient. Serverless offerings allow for thousands of parallel instances
per function, getting rid of most scaling issues. Last, but not least,
serverless offerings only charge for what you use, which can have a
tremendous benefit on your operational costs.
With serverless as a rendering layer and existing frameworks, front‐
end developers can write minimal backend functionality in pro‐
gramming languages they are familiar with, without dealing with
concerns that usually come along when operating servers.
It was Chris Coyier from CSS Tricks who realized that with the
availability of serverless, frontend developers have become full stack
developers now, taking care (at least in part) of server-side tasks.
Frontend Composability
When we integrate services like search or elements like navigation
and footers to a decoupled application, we need to consider how we
make this element available on all pages, no matter how they have
been created. There are various ways to compose user interfaces,
and as with any software architecture, one size does not fit all organ‐
izations. The appropriate way to assemble UI and thus compose
largely depends on how teams are structured, how responsibilities
are distributed, and what technology choices have been made.
Frontend composition has a strong relationship with micro-
frontends, an architectural approach that involves breaking down
Frontend Composability | 27
the frontend of an application into smaller, independent frontends,
each with its own UI components and probably routing logic.
The goal is to deploy frontends independently, allowing teams to
release features end-to-end, and also to include several technologies
from different teams on a single page so they can decide on their
stack independently. Luca Mezzalira describes several approaches
in his book Building Micro-Frontends (O’Reilly, 2021), and Michael
Geers explains the concept on the eponymous website https://micro-
frontends.org. Figure 2-7 shows how a UI is composed through
micro-frontends. In the figure, the product display, the checkout,
and the related products screen are all independent of each other.
All features are produced by different teams.
Frontend Composability | 29
foremost built upon reusable CSS classes that can then be used
for different frameworks like Angular, Vue, React, Svelte, or even
regular web components. If a new technology needs to be included,
the basic styles and patterns still work. The HTML for those patterns
has been defined, reviewed, and tested for accessibility. The “only”
thing missing is a concrete implementation in said framework.
Using React-specific technologies for CSS like styled components
would ultimately lead to lock-in. Styled components can’t be reused
in Vue, nor Angular, and most likely not in a technology that we
don’t know about yet. Basic CSS and HTML can be reused. The
effort of moving to a new frontend system, or maybe even getting
rid of frameworks entirely, is much lower if we can carry over
as many elements of our design language and implementation as
possible.
Having a simple CSS library with HTML examples also allows for
the creation of static pages for sites that don’t require modularity or
a complex setup, as an example. They still have the same look and
feel as the web application created on top of it.
All three elements, micro-frontends, UI frameworks, and design
systems, can be combined in a single application. For example, the
application performance monitoring company Dynatrace achieved
frontend composability in their AppEngine release by allowing
developers to build self-contained screens through a dedicated
application framework and design system. They use React as a base
technology for their components, providing reusable end-to-end
elements with a design system called Strato. Each “app” is encom‐
passed by an application shell, which serves as a mediator between
screens and provides globals like user information, URLs, etc., form‐
ing a micro-frontends architecture.
Third-Party Services
If we look at the lower parts of Figure 2-1 we see that a lot of
the services used can be served and provided by third parties. The
recruitment portal, search service, and headless CMS can be run
by SaaS offerings, leaving only the blogging software as well as the
build process for the documentation in the hands of the operations
team.
Third-Party Services | 31
If you go for SaaS offerings, evaluate vendors by asking the follow‐
ing questions:
• Does the SaaS offering allow you to export your data to a stor‐
age service like AWS S3? Maybe even a JSON dump of your
entire content structure? This way you can still read a snapshot
of your web application to keep your system going without
needing a live connection to the third-party service.
• Do SaaS offerings build on open standards and conventions?
For example, does your identity provider work with OAuth
2.0, so you only need to exchange APIs but not the authentica‐
tion/authorization flow?
• How strong does the connection to the SaaS product need to
be? Can you cache responses? Does your software fail if availa‐
bility falters, or can you bypass unavailable APIs and still offer
your users some content?
• How does the vendor introduce major updates to their plat‐
form? Do you have a migration period that allows you to move
to the next version? Do they have some long-term support
(LTS) model of their API? See whether their idea of LTS is
aligned with your sprint cycles.
• How does the vendor respond to security incidents? Check their
blog to see if there have been breaches and how they communi‐
cated them. Do they have an ISO 27001, PCI-DSS Level 1, or
SOC 1/SSAE-16 certification? Do they regularly check against
OWASP security threats? Do they dedicate a team to control
their cloud infrastructure? Are they GDPR compliant? How do
they handle sensitive data within the company? The vendor
should have this information publicly available. And you can
hold them accountable.
Conclusion | 33
About the Author
Stefan Baumgartner is a developer and architect based in Austria.
He is the author of TypeScript in 50 Lessons and TypeScript Cook‐
book, and runs a popular TypeScript and technology blog. In his
spare time, he organizes several meetups and conferences, like the
Rust Linz meetup and the European TypeScript conference. Stefan
enjoys Italian food, Belgian beer, and British vinyl records. He is also
an independent consultant and trainer for Rust and TypeScript at
oida.dev.