Below the Fold

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

Three copies of one window Three identical windows cascading forward, local, staging, and production, with a red dot on the front one.

Environments

After today, you can explain why teams run three copies of a product and what “deploy” means.

Dip your toes 1 min

An environment is one complete, running copy of a product. Most teams run three. Local is the copy on an engineer’s own computer. Staging is a shared test copy filled with test data. Production is the copy real people use. A deploy puts a version of the code onto one of those copies. Real data stays out of staging because it belongs to real people, so the test data there is small and tidy. That tidiness can hide problems in a design review. A Slack sidebar with three test channels won’t show what happens with three hundred, or with a name in Japanese.

The full lesson 10 min

Why this exists

Slack carries the working day of millions of people. If a change breaks message sending at ten in the morning, whole companies stop talking to each other. Yet Slack’s engineers change the product many times a day. They need somewhere to try a change that isn’t the place where everyone works.

The answer is to run more than one copy of the product. An engineer writes a change on a copy that only they can see. The team checks it on a second copy that looks like the real thing but has no real users. Only then does the change reach the copy everyone uses.

Each copy makes a different kind of mistake affordable. A broken copy on a laptop costs one engineer an afternoon. A broken shared test copy costs the team a day of testing. A broken copy in front of every customer costs the company money and trust. Teams run several copies so that most mistakes happen in the cheap places.

What it is

An environment is one complete, running copy of a product. It has its own version of the code, its own settings, and its own data. Settings here means configuration: values that change between copies without changing the code. Which database to connect to and which email service to use are typical examples. Most teams run three environments, and the names are close to universal.

  1. Local. The local environment is a copy running on an engineer’s own computer. Only they can see it. Its data is made up, often a handful of fake users and messages created by a script. This is where code gets written and tried first.
  2. Staging. Staging is a shared copy that matches production as closely as the team can manage. It runs on company servers, and the team and its testers use it. Its data is test data that someone created on purpose.
  3. Production. Production is the copy real users reach. On Slack, that’s every workspace, every channel, and every message. Engineers shorten it to “prod,” and “it’s in prod” means the code is running where real people are.

To deploy is to put a specific version of the code onto an environment’s machines and start it running there. Day 4 showed that merging a change doesn’t make it live; the deploy to production usually does. On some teams a deploy runs automatically after every merge. On others, someone starts it on a schedule.

Three copies of one productThree boxes side by side. Local is used by one engineer and holds made-up data. Staging is used by the team and holds test data. Production is used by every user and holds real data. Arrows labeled deploy carry the code from local to staging and from staging to production.DeployDeployUsed byDataLocalStagingProductionOne engineerThe teamEvery userMade-up dataTest dataReal data
Figure 1. The three environments most teams run, from an engineer’s laptop to every user. Look at production, the only copy with real users and real data. Everything to its left exists to protect it.

In a 2020 post on Slack’s engineering blog, its engineers described each build going to staging, then Slack’s own workspaces, then customers. Day 24 follows the rest.

Why not test carefully in production and skip the copies? Because a test that writes data in production writes real data. A test message lands in a real channel. A test signup sends a real welcome email to a real person.

Separate environments keep the team’s experiments out of customers’ lives. They also let engineers break things on purpose, which is often the fastest way to learn how something fails.

The copies stay separate in three ways. Each one points at its own database, so a message sent on staging never shows up in production. Each one has its own settings, stored outside the code so the same code can run anywhere. And each one connects to its own version of outside services.

Payment providers like Stripe offer sandboxes, test versions of their service where test card numbers work and no real money moves. Staging talks to the sandbox, and production talks to the real thing.

Settings are often stored as environment variables, named values the code reads when it starts. One holds the database address. Another holds a payment key, a secret string that lets the code use a service, and another a switch for real email. The same build of the code reads different values in each environment, and those values decide where it writes and who it charges.

Same code, different settingsOne box labeled same code feeds three environment rows. Local uses a laptop copy of the database and a Stripe sandbox. Staging uses a staging copy of the database and a Stripe sandbox. Production uses real data and live Stripe.DatabasePaymentsSame codeLocalStagingProductionLaptop copyStripe sandboxStaging copyStripe sandboxReal dataStripe live
Figure 2. One build of the code, run three times with three sets of settings. Look at the settings columns. They’re the only part that changes from copy to copy.

Nothing in the code says “this is production.” The settings do. Stripe puts “test” or “live” inside every key it issues, so a mix-up is easier to spot. When a bug appears in only one environment, the settings are among the first places engineers look.

Many teams add more environments as they grow. A preview environment is a short-lived copy built for one branch, so reviewers can see a change before it merges. Some teams keep another copy for demos or for testing how the product holds up under heavy use.

The names multiply, but the idea stays the same. Each copy exists so a certain kind of mistake can happen somewhere harmless. Day 24 covers the pipeline that runs deploys for you.

How it shows up in your work

Design review is where you’ll meet environments most often. When an engineer sends you a link to review a change, check which environment it points at. Staging addresses often contain “staging,” and some teams add a colored banner so nobody confuses the two.

Reviewing on staging means you see the change before users do. It also means you see test data, which can hide layout problems. A sidebar with three test channels won’t show you what happens with three hundred. Before the review, ask for an account loaded with realistic content, or bring your own list of edge cases to try.

The promotion path for one changeThree lanes from top to bottom: local, staging, and production. A line for one change runs along the local lane on Monday, drops to staging with a deploy, passes a design review and the moment it works on staging on Tuesday, then drops to production with a second deploy, where users see it on Wednesday.LocalStagingProductionDeployDeployWritten and triedDesign reviewWorks on stagingUsers see itMondayTuesdayWednesday
Figure 3. One change moving from a laptop to staging to production over a few days. Look at the moment it works on staging. It’s the last point to catch a problem before users see it.

“I saw it on staging” and “a customer saw it in production” lead to very different responses. A production bug can pull someone off their current work within minutes. A staging bug usually goes into the queue for the next few days. When you report something, name the environment, the account you used, and what you were doing. If you can’t make it happen on staging, say so, because that’s a clue the cause lives in data or settings.

A launch often means a deploy to production, or flipping a flag (Day 24), usually at a quiet hour with people watching. Ask what happens if something looks wrong right after. On many teams the previous version can go back out within minutes, and knowing that changes how nervous you need to be. It also helps you plan which screens to check first once the change is live. Check them in production with a real account, not on staging, because that’s the only place the real conditions exist.

The one thing people get wrong

“It works on staging” gets taken as a promise about production. Staging exists to make that true, and it gets close. But staging is a copy, and copies lose things. The differences are small and specific. They’re behind a familiar kind of bug: the one nobody could make happen before launch.

Staging isn’t productionA table comparing staging and production in three rows. Data: small and tidy versus huge and messy. Traffic: a few testers versus millions at once. Settings: test keys versus live keys. A red column lists what slips through each gap: broken layouts, slowdowns, and failures that happen only live.StagingProductionWhat slips throughDataTrafficSettingsSmall, tidyHuge, messyA few testersMillions at onceTest keysLive keysBroken layoutsSlowdownsFails only live
Figure 4. Where staging and production differ, and what slips through each gap. Look at the data row. Tidy test data is the gap that hides the most design problems.

Data is the biggest gap. Staging holds data someone made up, and made-up data is tidy. Real workspaces have channels with thousands of members, display names in Arabic and Japanese, and messages that run for pages. A layout that looks right with “Test User 1” can wrap, cut off, or overflow with a real name.

Volume matters too. A search that feels instant across a few hundred test messages can crawl across years of real ones.

Why not copy real data into staging? Because real data belongs to real people. Copying private messages into a test environment puts them in front of more engineers and more tools, with weaker protection. Some teams copy production data with personal details stripped out, but that takes real work and still misses things. So staging stays tidy on purpose, and the gap is a trade-off, not an oversight.

Traffic opens another gap. Staging gets a few testers at a time, while production gets millions of people at once, many doing the same thing. A screen that loads fine for one person can slow down badly when a large company starts its Monday.

Settings are the last. Production uses live keys, real email services, and real payment accounts, and one setting entered wrong can fail only there. Third-party sandboxes don’t behave exactly like the real service either. Stripe’s sandboxes, for example, don’t email receipts to customers by default.

This is why careful teams treat a production deploy as the start of a new round of checking. They watch the product closely right after a change goes out. You can design for the gap as well. Ask for realistic test data in staging: long names, empty states, huge lists, and every language your product supports.

Ask an engineer this

“Which differences between staging and production have bitten us before, and how would I spot one in a design review?”

Ask this after a launch, while a bug that only showed up in production is still fresh. Engineers who’ve lived through one will name specific differences: the data, a setting, an outside service, or the load. Find out whether the team has done anything to close the gap, like better test data or a staging account that mirrors a large customer. Follow up by asking which of those differences a designer could have caught. Often it’s the data, and that’s a gap you can help close.

Terms from today

Environment
One complete, running copy of a product, with its own code version, settings, and data.
Local environment
A copy of the product running on an engineer’s own computer, where changes get written and tried first.
Staging
A shared copy of the product that matches production as closely as the team can manage, used for testing before real users see a change.
Production
The copy of the product that real users reach, with real accounts, real data, and real money.
Deploy
To put a specific version of the code onto an environment’s machines and start it running there.
Next

Day 6: Frontend, backend, database

The three jobs, what talks to what, and the simplest version of the request-response idea.

5

Environments

All 30 days