Benefits of preview environments

One of the products Coherence offers are preview environments, aka ephemeral environments for every branch. This article will discuss their benefits and how they integrate within the Coherence software development life cycle (SDLC).

Traditional staging bottlenecks

Before the cloud, most software teams had a single staging environment. This created a bottleneck for developers. Under this paradigm, developers would "get in line" and wait their turn to deploy to production.

In addition to being a bottleneck, staging environments are notoriously difficult to maintain. One of the difficulties with maintaining a staging environment is keeping it in sync with production. Staging is supposed to simulate production as much as possible to provide confidence that if things work correctly there, they should work the same way in production. In practice, however, this is rarely the case since keeping staging in sync with production is often a nightmare.

The pain points and frustrations caused by a single staging environment often force developers to devise clever ways to circumvent staging altogether, like creating their own "staging" environments. This, in turn, introduces additional complexity, overhead, and yak shaving – not to mention a potentially serious security risk.

Ephemeral environments eliminate these issues because each piece of work has its own "staging" environment. Instead of a single environment shared by all developers, every branch has its own entirely isolated environment. Bottlenecks and developers "waiting in line" are no longer an issue since developers can spin up new environments in seconds.

Collaboration & feedback

Before preview environments, developers often created screen shares, screenshots, and videos showing their work to stakeholders and other teams. This would often lead to "review meetings" where stakeholders, product, design, and other teams would gather to review work. Collaboration and feedback were difficult to do asynchronously and time was often wasted.

Preview environments are easily shared via a URL, making screen shares, screenshots, videos, and "review meetings" a thing of the past. Work can be reviewed asynchronously, saving time, money, and meetings. Sales teams also benefit from preview environments since they allow them to demo new features to prospective customers.

In Coherence, our preview environments are created automatically for every branch with a unique URL. Anytime a developer wants to share their work, all they have to do is share the link.


Ephemeral environments also provide several benefits when it comes to testing. Knowing that each environment is nearly identical to production provides increased confidence that the code will work when deployed to production.

Developers performing code reviews typically only check the "diff" of proposed changes instead of testing the code locally. It is often too time-consuming and difficult to rebuild their local environments, so developers usually skip this critical step altogether. Preview environments eliminate the friction of rebuilding local environments, which in turn means better code quality and fewer bugs.

Let's be honest with ourselves, when it comes to testing, we all cut corners we know we shouldn't because of how fast our teams need to move and how difficult maintaining various environments can be. Ephemeral environments require little to no maintenance, meaning work can be tested with the quality and thoroughness you know it should be.

Automated infrastructure

Ephemeral environments and the infrastructure that powers them are automated and require little intervention. Every time a developer opens a new PR, a new environment is created exclusively for that piece of work. These environments are designed to be created and destroyed quickly. Because of this, if an environment becomes corrupted or breaks for any reason, a new one can be spun up in seconds.

Since these environments are automated, your DevOps team has one less thing to worry about. We all know that DevOps teams are under significant stress and often overwhelmed. Having automated preview environments means they can focus more on pertinent matters.

Cost control & savings

As mentioned previously, preview environments are ephemeral by design, meaning they only live as long as you need them. This means significant savings since you no longer have to pay for environments that are not in use. For example, you can automate these environments to spin up for every pull request and have them automatically destroyed when it is approved and merged. The environment only exists for as long as necessary, saving you lots of money in the long run.

Preview environments and the Coherence SDLC

Preview environments are an integral part of the Coherence SDLC. After creating a new branch in Coherence, an isolated ephemeral environment is automatically created for it. Development is done via a workspace, and the new code is then pushed, via git, to the branch. Coherence automatically triggers a new build, updating the environment with the latest changes. Developers can then easily share the environment with whomever they wish via a unique URL. Once the branch has been approved and merged, Coherence will automatically destroy the environment and its underlying infrastructure.