Sam Breed

Product Developer, Investor

Layered Architecture

A Theory of Applications

First posted on

Last updated on

A better name for this page might be Types of Frontend Systems.

This essay describes a way to categorize software applications that I developed as a consultant and developer on product and app platform teams. I started dropping this metaphor without ever laying it out formally, having tuned into common the vibrations and reoccurring patterns across dozens of applications of different levels of complexity.

The starting point is not original: applications are made up of layers of abstraction. Layers determine complexity and limit what types of features you can build. Layers pile on top of on another, and each new layer conceals and adapts the layer below. In practice, an application will touch many layers simultaneously to achieve its goal.

The history of computing tracks the accretion of layers of technology: electrical switches and relays gave way to vacuum tubes, which yielded to transistors and solid state devices; programming in binary led to assembly language and hexadecimal, ultimately ceding to the first “high level” languages; stateless machines requiring tedious input on each power cycle drove the need for boot loaders and BIOS, accidentally birthing operating systems in the process. Operating Systems, for a time, became the venue for applications. Web browsers emerged to offer a new delivery vector for software applications, and today, after 30 years of growth, the web touches every business on the planet.

”Layer 0” is the computer. The definition of the computer changes over time.

WhenLayer 0
60 years agoassembly language
30 years agooperating systems / PCs
Todayweb browsers / mobile devices

Table of Contents

Layer 1 - Static Content

Static content, once deployed, doesn’t change. The client is the only runtime. With no shortage of hosts offering free or nearly-free options, static hosting has long been a commodity.

Here’s a little table to help count the layers. The first layer is obviously simple:

LayerDescription
1StaticFixed content

Layer 2 - Templates

Dynamic content

A runtime that generates content on each request using fixed templates.

Our little table gets bigger! You can very much think of Templates as an outgrowth of Static content, so a new cell has been added to the right:

LayerDescription
1StaticFixed content
2TemplatesDynamic content

Layer 3 - Content from a Database

Interactive multi-user application, Content Management System, Client <-> Database

Layers are cumulative. Building on the 2-Layer system, users manipulate the content they see using the application itself.

This is your standard CRUD app.

Another layer added to the table:

LayerDescription
1StaticFixed content
2TemplatesDynamic content
3Content from DBUsers r/w content

Layer 4 - Templates from a DB

Interactive multi-user application with custom presentation, CMS with dynamic templates (“Dynamic CMS”)

When a CMS allows a user to define both the content and the layout, you enter the territory of a dynamic CMS. Users are able to control the presentation of their content as well as the content itself in a single feedback loop.

LayerDescription
1StaticFixed content
2TemplatesDynamic content
3Content from DBUsers r/w content
4Templates from DBUsers r/w templates

Layer 5 - Many Instances

Multi-tenant Dynamic Applications

Not only are there users and user-created content, but there are self-administered groups of users with fine grained access control. Once multi-tenancy enters the picture, it’s difficult to continue calling

LayerDescription
1StaticFixed content
2TemplatesDynamic content
3Content from DBUsers r/w content
4Templates from DBUsers r/w templates
5Many InstancesGroups of users & RBAC

Layer 6 - User Programmable

Dynamic templates with Runtime

It is not enough to merely allow users to manage themselves and the template and the content. The next step is to let users define programming logic and side effects.

Our humble table needs to pivot in order to fit it all in:

LayerDescription
1StaticFixed content
2TemplatesDynamic content
3Content from DBUsers r/w content
4Templates from DBUsers r/w templates
5Many InstancesGroups of users & RBAC
6User ProgrammableLogic defined externally

Layer 7 - Dynamic Infrastructure

Multi-tenant Dynamic Infrastructure

The deeper you get into the layered stack, the more you start looking like a hosting company. When a standard CRUD application transitions beyond user-defined layout and user-defined program logic, the only territory left is to define the infrastructure for running the program.

The classic value-proposition of cloud computing goes something like, “tell us what resources you need and we will provision them for you, and don’t worry about the details.”

With this architecture, Salesforce transformed the scope of its business from CRM to “everything.”

Kubernetes, the open source ancestor of Google’s Borg cluster management software, provides the framework for building a layer 7 application.

Vercel is building the Frontend Cloud.

LayerDescription
1StaticFixed content
2TemplatesDynamic content
5Many InstancesGroups of users & RBAC
3Content from DBUsers r/w content
4Templates from DBUsers r/w templates
6User ProgrammableLogic defined externally
7Dynamic InfrastructureCongratulations, you are a hosting company

https://www.cloudflare.com/learning/ddos/glossary/open-systems-interconnection-model-osi/

Categories