Below the Fold

A designer’s path to creative technologist. Thirty days, ten minutes each, on how software actually gets made.

A stack of layers Four flat layers stacked like sheets of paper, with a red dot marking the layer where a problem lives.

What a stack is

After today, you can explain what a stack is, name its four layers, and predict which layers a feature request will touch.

Dip your toes 1 min

A stack is the set of layers a product runs on, from the screen you touch down to the computers in a data center. Most products have four. The frontend is the code on your device that draws the screen. The backend runs on the company’s servers, computers that answer many users at once, and makes decisions. The data layer stores information, and the infrastructure is the machines and networks under everything. Tap play on Spotify, and the app asks Spotify’s computers whether your account may play that song. They check stored records, and only then does the app fetch the audio. Those layers are why requests differ so much in cost. A new button label stays on the screen and is quick to change. Sorting playlists by mood touches every layer, so it takes far longer.

The full lesson 9 min

Why this exists

Tap play on Spotify and a song starts in about a second. It works the same on a phone, in a car, in a browser tab, and on a smart speaker. Behind that one tap sit thousands of engineers, millions of lines of code, and a fleet of computers. No single person understands all of it, and no single program does all of it.

Teams handle that size by splitting the product into layers. Each layer has one job, and each one talks mostly to the layers next to it. The people who build the play button don’t need to know how audio files are stored. The people who store audio files don’t need to know what the play button looks like. That separation lets a company change one part of the product without breaking the rest.

What it is

A stack is the set of layers a product runs on, from the screen you touch down to the machines in a data center. Engineers draw it as a pile of boxes, with the user at the top. The names vary from company to company, but almost every product has the same four layers.

  1. Frontend. The code that runs on your device and draws what you see. On Spotify, that’s the app on your phone or the web player in your browser.
  2. Backend. The code that runs on a server, a computer, or a program running on one, that answers requests from many users at once. It makes the decisions, like whether your account can play this song in this country.
  3. Data. The databases, programs built to store and find information fast, plus storage for large files. Your playlists live here, and so do the audio files.
  4. Infrastructure. The computers, networks, and cloud accounts the other layers run on. The cloud is computing power you rent from a company like Amazon or Google instead of owning the machines.

Most stack diagrams add a column on the side for third-party services, which are products other companies run that you plug into yours. Card payments through Stripe and maps from Google are common examples. They aren’t a layer of your stack, but your stack depends on them.

Here’s a simplified version of the play button again, layer by layer. The Spotify app on your phone shows the button and sends a message to Spotify’s backend when you tap it. The backend checks your account and the song’s license against records in a database. It tells the app where to fetch the audio file, and the app starts playing it. All of that backend and data work runs on Google Cloud, which Spotify began moving to in 2016.

Why doesn’t the app decide on its own whether you can play the song? Because the frontend runs on a device the company doesn’t control. Anyone can inspect or alter the code running on their own phone or browser. So anything that matters, like who can play what, what something costs, or who can see which data, gets decided on the backend. The frontend can hide a button, but only the backend can enforce the rule behind it.

One tap on Spotify’s play buttonFour layers from top to bottom: frontend, backend, data, and infrastructure. The app asks the backend if a song can play, the backend checks the database and answers, and the app then fetches the audio from file storage.You tap playFrontendBackendData: databaseData: file storageInfrastructure: Google CloudThe Spotify app on your phoneSpotify’s servers make the decisionAccounts, licensesAudio filesThe machines and networks the backend and data run on1324Can I play this song?Yes. Fetch theaudio from here.Check account and licenseApp getsthe audio
Figure 1. One tap on Spotify’s play button passes through all four layers of the stack. Look at how the backend sits in the middle and decides whether the song can play before any audio moves.

The phrase “full stack” comes from this picture. A full-stack engineer works in both the frontend and the backend. The distinction is real because the layers use different languages, different tools, and different ways of failing. Most engineers specialize in one layer. Full-stack roles are most common at small companies, where there aren’t enough people to split the work.

You’ll also hear “client” for the frontend side and “server-side” for the backend. A client is any program that asks a server for something, like the Spotify app or your browser.

You’ll also hear “stack” used a second way. “Our stack is React, Node.js, PostgreSQL, and AWS” lists the specific tools filling each layer, which people call the tech stack. In that sentence, React draws the frontend and Node.js runs JavaScript code on the backend. PostgreSQL is a popular database, and AWS (Amazon Web Services) is Amazon’s cloud.

Same layers, different toolsFour layers, frontend, backend, data, and infrastructure, in a column on the left. Beside them, one team fills the layers with React, Node.js, PostgreSQL, and AWS, and another team fills them with Vue, Python, MySQL, and Google Cloud.The layersOne teamAnother teamFrontendBackendDataInfrastructureReactNode.jsPostgreSQLAWSVuePythonMySQLGoogle Cloud
Figure 2. Two teams’ stacks: the same four layers, filled with different tools. Look at the column of layers, which stays the same while every tool beside it changes.

How it shows up in your work

In a planning meeting, the number of layers a request touches is a rough guide to its cost. Changing the label on a button is a frontend change. On the web it can ship the same day; in a phone app it waits for the next release. Letting Spotify users sort a playlist by mood touches every layer.

A mood sort needs a new control on the screen and new backend logic. It also needs new data stored for every song, and more computing power to calculate it. When an engineer says “that’s a backend change,” they’re telling you something about scope.

When something breaks, the first question engineers ask is which layer broke. Say your Instagram feed shows up blank. The frontend might be drawing it wrong, the backend might be sending nothing, the data might be missing, or the infrastructure might be down. Good bug reports help narrow it down. Note whether a refresh fixes it, whether it happens on every device, and whether other people see it too.

Larger companies organize teams around layers. A platform team, a group that builds shared tools for other engineers, often owns the infrastructure. A frontend team might own the app, while a separate team owns each major piece of the backend. Knowing which layer a change lives in tells you whose roadmap it has to get onto, and who needs to be in the review.

Who works whereThe four layers stacked from frontend to infrastructure, with bars beside them. Frontend engineers span the frontend, backend engineers span the backend and data, a platform team spans infrastructure, and full-stack engineers span the frontend and the backend.The layersWho works thereFrontendBackendDataInfrastructureFrontendBackendPlatform teamFull-stackengineersengineersengineers
Figure 3. Which layers each kind of engineer usually works in. Look at the full-stack bar, the only one that spans both the frontend and the backend.

The one thing people get wrong

“We’re a React and Postgres shop” sounds like a description of the system. It’s really a list of brand names, the tools filling the layers today. Tools inside a layer change more often than you’d think. When Spotify left its own data centers for Google Cloud, its infrastructure tools changed completely, and the four layers stayed where they were.

The four-layer stack, with a tools slot in each layerFour stacked layers, each with its job and an empty tools slot to fill in: frontend, backend, data, and infrastructure. A third-party services box connects to the backend from the side.The userFrontendBackendDataInfrastructureJob: draws the screen, runs on the deviceJob: makes decisions, runs on company serversJob: stores and finds information and filesJob: the machines and networks under everythingToolsToolsToolsToolsToolsThird-partyservicesProducts othercompanies runthat you plug in
Figure 4. The four-layer stack, with an empty tools slot in each layer for you to fill in over the next 29 days. Look at the infrastructure tools slot. When Spotify moved to Google Cloud, only what fills that slot changed.

The decision that shapes a product is which layer does a job. Take search filters. If the frontend filters results, it feels instant, but it only works on what’s already been loaded to the device. If the backend filters, it can search everything, but each change waits for a message to travel to the server and back.

When engineers argue about “where this logic should live,” they’re having a stack conversation, even if no tool names come up. Those are the conversations where a designer’s input changes the outcome.

Where the filter runsTwo versions of one search filter. On the left, the frontend filters the results already loaded on the device: instant, but it only sees what’s loaded. On the right, the frontend sends each change to the backend and waits for the answer: it sees everything, but each change waits for the server.Filter on the frontendFilter on the backendFrontendFrontendBackendResults already loadedInstantSees everythingOnly sees what’s already loadedEach change waits for the server
Figure 5. The same search filter, run on the frontend or on the backend. Look at the results already loaded on the left: they’re all a frontend filter can search, which is why it feels instant and can miss things.

Ask an engineer this

“If we added one new field to this screen, which layers of our stack would that change touch?”

Pick a real request from your backlog, ideally a small one, and ask while you’re both looking at the screen it belongs to. Count the layers they name as the change travels down, and note whether another team owns any of them. Then ask which part would take the longest. What you hear is a first, honest version of the stack for your own product. Sketch Figure 4 and write the tools they mention into each slot.

Terms from today

Stack
The set of layers a product runs on, from the code that draws the screen down to the machines in a data center.
Frontend
The code that runs on the user’s device and draws what they see and touch.
Backend
The code that runs on the company’s servers and makes decisions on behalf of every user.
Infrastructure
The computers, networks, and cloud accounts that every other layer of the stack runs on.
Full stack
Describes an engineer or a piece of work that spans both the frontend and the backend.
Next

Day 2: What code looks like

Languages, runtimes, files and folders, and what you see when you open a codebase for the first time.

1

What a stack is

All 30 days