Over my years in software development, the one topic that comes up a lot and is often ignored is environments. So here, based purely on anecdotal evidence, is what I know about software environments.
There are seven environments
I know about seven environments that software can run in. Are all seven necessary? Probably not. In some cases they even serve similar purposes. The truth is, you only ever need ONE environment. The others serve the purpose of improving the one. That one? Production.
- Quality Assurance (QA)
Production is the one and only environment that matters. Production is where your code sits when people are interacting with it. Whether production is a webserver, or a distribution channel where people download and install your application locally. What matters is, your production code is the code that people rely on, bug report on, and request features on.
Beta is a form of production. A beta environment is the environment that your less risk-averse users will use to get the latest features of your application sooner. That means this is basically a slightly buggier production environment with more features. That also means that this environment is technically a subset of production.
Staging is a copy of production. The staging environment is where you demonstrate new production features before they go into production. Quite often, staging uses the production data for read, but doesn’t write to it. A great example of staging in action, is a demo site that you show clients what your application looks like, fully functional, before selling it to them.
QA is the environment your manual testers use. If you don’t have a team of testers, you probably don’t need a QA environment. It is a form of a test environment, with the exception that it is deployed code in the exact same way that production code will be deployed so that your testers are not dealing with tweaks made by developers that may or may not have happened in production. The idea is that your testers can deploy the latest version of the application to the QA environment and see if it works.
The test environment is usually used as the QA environment, but ideally it is a more flexible environment that developers can test against as well. This means that sometimes it is used for performance testing and load testing an application, which would make QA unusable if testers were working in it.
The dev environment is just for developers. This environment often has custom tweaks, is constantly breaking, and serves the purpose of a realistic environment for developers to test out the new features their working on. In many places, the development environment is the local environment, but that is not always the case. It’s important that dev and production be separate, because otherwise, when developers are trying something new, they’re likely to cause you to lose users when they break things.
The local environment is the develper’s computer. This sometimes includes the code that matches the development environment, but some companies have almost nothing local except what the developer wants to use to edit code (text editor, IDE, etc). Everyone has a local environment, even you, reading this post.
What does that mean?
A great way to demonstrate this may be to use this blog as a comparison. As a blogger, I write my code on my computer in a web browser. The computer and web browser I’m using is my local environment. The blogger editor I’m using is from google, on their servers. That tool is my development environment. Blogger lets me click “preview” and see my blog post as it would look when published. That is my test environment, which since I don’t have testers doubles as my QA environment. I don’t release multiple versions of my blog posts, so I don’t have a beta evironment. And what you’re reading right now is my production environment.
Why would I need all that?
You don’t. Many companies don’t have half or more of these. Moreover, it’s important to understand that most companies mix up the names. I can’t name the number of companies that used their “Staging” environment for QA. Very few companies have need for a Beta environment: Netflix, Twitter, Google. Even less companies I know of have all three of Dev, Test, and QA. Usually they mix either Dev and Test, or Test and QA. And often, as above, Test and QA are mixed into one environment called “Staging” and there is no other Staging environment.
So how do I know what I need?
Expand as you go. Like you do with the company, as the complexity and needs grow, so does your development team, and so does your need for environments. I’m currently working on an application with one other developer and 2 testers/users. Always paranoid about quality, I have 2 environments currently: Local and Test. I have no need for a Production environment yet, as the application is not yet finished. That said, the complexity of the Test environment, and it’s use has grown to the point that I think it’s time to add another environment. Because my “users” are using the Test environment to insert data that I plan to later use in Production, I’m converting my Test environment to Staging, and creating a Development environment that is separate from my Local environment so that I can verify things work a bit better without breaking the functionality my users need.
What’s right for me?
There is no perfect choice. In fact, while this list is somewhat comprehensive, I’m not perfect and there are probably other environments people use that I’m unaware of. More than that, some of these environments might split out into multiples. Perhaps you have a Staging for Production and a Staging for Beta. Perhaps you have a Beta for each new feature you want to test. Perhaps you have one Development environment per developer, one Test environment per new feature. What you need depends on your team and your functional needs. It’s up to you what works best for your team, but it’s important to know what’s out there, and that’s what this post is all about.
Other environments you know about? Let me know in the comments.