Ephemeral Environments: The Modern Approach for Better and Faster Testing

Tech companies are gradually adopting the modern CI/CD flow that facilitates rapid releases and fast collaboration between team members. Traditional staging environments are being replaced with ephemeral environments because the shared staging environments do not support the culture of fast-release cycles mentioned earlier. As the traditional staging or testing environments are shared, one developer’s feature can cause bugs, making the whole environment unusable. Similarly, the shared environments do not allow team members to collaborate frequently, so the product does not get the internal feedback it deserves. Ephemeral environments solve all these problems. They have revolutionized the way you perform testing and deployment. Let’s go through the benefits of ephemeral environments and discuss a real-life use case of a company that used ephemeral environments to accelerate its business.

Morgan Perry

Morgan Perry

November 23, 2022 · 7 min read
Ephemeral Environments: The Modern Approach for Better and Faster Testing - Qovery
Written byMorgan Perry

Morgan Perry

CRO and co-founder of Qovery. Morgan is a Tech entrepreneur with 7+ years of experience in the SaaS industry.

See all articles
DevOpsPlatform EngineeringCloud

Let’s start with what is actually an ephemeral environment.

What Are Ephemeral Environments?

Ephemeral means temporary. An ephemeral environment is a temporary but fully functional lightweight deployment environment that is a copy of your existing staging, UAT, or production environment. Once you define your existing environments in the form of a template, it is super easy to spin up their cloned copies which are actually ephemeral environments. Each ephemeral environment works in complete isolation from other ephemeral environments, and other team members can access each ephemeral environment through its unique URL.

Why it Matters?

Infrastructure is a key part of an application's behavior. The architecture and requirements are continually evolving. The question then arises as to how to incorporate these changes and developments into a suitable testing workflow with a high degree of confidence. This is where the Ephemeral environments come into play. Ephemeral environments allow you to integrate infrastructure and deployment processes into a testing suite. They ensure your testing environment is always in-sync with production, allowing you to iterate quickly to meet new requirements. In addition, Ephemeral environments encourage you to lean on automated tests over manual tests, ensuring that your application behaves as expected.

How and When to Use Ephemeral Environments: A Use Case

Let’s discuss a use case of a real company that solved its efficiency problems by adopting ephemeral environments.

Context

The company is developing a rich API that a SaaS application will consume, but clients would also need to consume those API’s directly to be integrated into their existing systems. There is one production environment and one staging environment, and API’s are containerized through docker containers. The CI/CD pipeline is fully automated. As soon as the code is pushed, a suite of automated testing runs, and if it is successful, then the build is deployed on production. If the test suite fails, then the build is rolled back. The team comprises front-end/back-end developers, product managers, QA engineers, and DevOps engineers.

Problem

Although the current setup is fully automated because of automating testing suite and automated pipeline, however, the team is struggling in the following areas:

  1. As the staging environment is shared and static, when all features and bug fixes are deployed to staging at the end of the sprint, all hell breaks loose. The QA engineers complain that the developer did not test his/her tickers properly, while the developers claim that it worked fine in the development environment. When a showstopper bug is faced in staging, all the teams stop work because they cannot resume testing on staging unless that showstopper bug is resolved.
  2. The release happens only after two weeks; however, the staging cloud infrastructure is billed 24/7. This is causing much money which should be saved somehow.
  3. The end product cannot benefit from the mutual collaboration and feedback from the other stakeholders like the product manager, UX designer, and head of product development because there are too many features and bug fixes waiting for review in the staging environment. After all the pieces finally start working, there needs to be more time left for feedback incorporation.

Solution

The team needs to adopt ephemeral environments, also known as preview environments. Let’s see how ephemeral environments solve the above problems.

  1. Each developer can thoroughly test his/her features on the temporary, ephemeral environment, a replica of the staging environment. Each code push by a developer will provision an ephemeral environment having just one code branch. Anyone can test that particular features in complete isolation in that ephemeral environment. A large team might have dozens of temporary, ephemeral environments open during the sprint and closed within a few hours or days. The ability to test each feature in isolation allows teams to test efficiently. Even if a showstopper bug is faced that only affects the particular ephemeral environment where it is deployed, other teams using other ephemeral environments at the same time will keep testing other features in their respective ephemeral environments.
  2. The infrastructure of ephemeral environments is temporary. Only when you provision the ephemeral environment the underlying infrastructure is allocated. Developers quickly spin up an ephemeral environment, test, and close the feature. As soon as they close the ephemeral environment, its associated infrastructure is also removed. You do not need to pay the 24/7 cost of the infrastructure.
  3. Now developers provision the ephemeral environment for each feature and share the unique URL of that ephemeral environment with QA engineers and other stakeholders for quick feedback. When code PR is updated because the developer incorporated some feedback, the ephemeral environment is also automatically updated.

Results & Benefits of Ephemeral Environments

Reduce bugs in production and downtime

Ephemeral environments reduce production bugs because most are reported and fixed in ephemeral staging environments. As the ephemeral environments can be a replica of staging or production, bugs can be produced and fixed during testing on staging replica ephemeral environments. Overall downtime of production and staging environment is also reduced because the issues that cause downtime are identified and fixed on ephemeral environments before final deployment on production. Clones of staging and production environment allow everyone to develop in a production-like environment. This results in fewer regression bugs and cleaner code, and you can merge the code without worrying about breaking the application.

Reduce bottlenecks and speed up release cycles

Ephemeral environments reduce the bottlenecks caused by shared staging environments. You can test each feature in isolation and share each ephemeral environment with other team members for quick feedback. Any blocker bug is blocking just the ephemeral environment where it is deployed; other ephemeral environments will be unaffected because each ephemeral environment works in complete isolation. This allows you to speed up your release cycles and market your product much faster. You can now also incorporate the feedback of different stakeholders at the early stage instead of waiting for one massive final deployment at the end of the sprint.

Gain a self-serve approach for developers

Ephemeral environments bring autonomy and confidence in developers because they do not depend on the Ops team for environment provisioning. Using the self-service portal, they can spin different ephemeral environments independently. Using a self-service portal allows them to have better control of the deployments and releases. The ability to self-govern the deployment environments also improves the code quality of the developers.

Promote team collaboration

The biggest beneficiary of ephemeral environments is the product itself. When different cross-functional team members collaborate through ephemeral environments, they can add a lot of business value to the product being developed. This allows teams to go the extra mile in refining the product; after all, whatever they are doing is confined to a specific ephemeral environment that is working in complete isolation. The end result is a product that is a rich blend of different ideas from all the stakeholders. This is impossible if you still use the traditional shared staging environments.

Save time and money

Businesses can save a lot of money and time if they adopt ephemeral environments. You do not waste much time setting up a complex deployment environment, saving valuable time. The time which you can invest in making the product more valuable. The infrastructure cost is also reduced because you pay for only the time you actually use the environment instead of 24/7 infrastructure. Once you have set up the template or blueprint of your staging or production environment, developers can easily replicate these environments without relying on Ops teams; this reduces your DevOps bill too. You also save time on blocker issues in shared environments where everyone is affected by a regression bug and waiting for this bug to be fixed so that the environment is operational again.

Conclusion

Ephemeral environments are a modern approach for better and faster testing. It provides a more scalable and effective solution to environment management, especially if your team is growing. A market-leading solution like Qovery can help you adopt such a solution easily. With the help of Qovery, you can quickly implement a full fledge ephemeral environment system on your existing setup in just minutes instead of spending months on recreating a complex deployment environment.

To experience first-hand the power of Qovery's Ephemeral Environments, start a 14-day free trial.
Sign–up here - no credit card required!

Create Production-like Environments at the Speed of Light

Qovery is a Platform to easily duplicate your infrastructure and create production-like environments in your AWS account; Compatible with all your AWS services!

Try it out now!
Create Production-like Environments at the Speed of Light
DevOpsPlatform EngineeringCloud

You might also like


7 Essential Factors When Choosing Platform Engineering Solution

The trend of Platform Engineering is now gaining momentum, which analysts and industry experts refer to as one of the most disruptive philosophies of the moment. But regardless of experts’ predictions and assumptions, what matters for organizations today is understanding what adopting an approach such as Platform Engineering actually entails, what a successful solution looks like, and how to adopt best practices for its implementation. That's what this article is about. A successful Platform Engineering tool will provide immense benefits to the organization. You will achieve rapid product releases, reduce operational complexity, scale applications through environment automation, and many more. However, an effective platform engineering tool must have certain traits to achieve the benefits mentioned above. Today, we will discuss the 7 key factors necessary for a great platform engineering tool. Incorporating these 7 components will ensure that your platform engineering tool will serve its purpose. - Read more

November 10, 2022 · 6 min read
7 Essential Factors When Choosing Platform Engineering Solution