WavebreakmediaMicro - Fotolia

Tip

Steps to safely build and manage a preproduction environment

A well-run testing lab is a true asset to developers. An uncontrolled one, on the other hand, is a massive liability that can cost dearly. Plan lab builds along these guidelines.

To minimize application issues in production, it's best to create separate production and development infrastructure. One way to ensure this separation is through a dedicated testing lab. However, there are often complicated steps involved to set up these preproduction environments -- it is not unlike an art form.

To shape a functional lab quickly, carefully determine its scope, decide where to host it and prepare for some common security and resource management challenges.

Go in with a plan

In general, it's easier to implement a greenfield -- meaning wholly new -- site for a preproduction environment than it is to retrofit an existing setup that could have outdated policies and documentation. To implement a well-designed and effective lab, lay out these key factors.

Purpose of the lab. Determine whether the environment will serve a sole purpose -- such as to test new features for a customer outreach app -- or support several development projects with different requirements.

Rules and restrictions. Define what sorts of actions are allowed in the environment -- simply put, set expectations. Can testers use customer data to run simulated transactions? Should the lab connect to the public internet? To minimize the risk of data and IP theft, set restrictions that are reinforced by the lab's resources and configuration. For example, implement safeguards to prevent a developer from using a copy of a production database in the lab. Otherwise, there's a risk of exposing sensitive data and personally identifiable information.

Cost. Although it's not intended for production environments, a dev and test lab still comes at a cost. Estimate upfront the expenses of required infrastructure and software components, as well as maintenance and support.

Hosting location. Ops teams need to assess where to host the preproduction environment: in the cloud or on internal infrastructure. This choice will depend on a company's application development model -- including whether that model is cloud-native -- and should be much more than a cost decision, as it also pertains to strategic mobility.

Manage access and security

After defining the basic goals and requirements for the dev and test environment, address access and security. Should the environment be able to connect to production infrastructure? Security is a question for the company as a whole, not just for developers, because, as access increases, so does risk. However, organizations need to carefully balance access with ease of use and other developer requirements, such as the ability to deploy tested code rapidly.

Like an actual production environment, the lab should have robust role-based security. Without good, documented processes to request and track access to resources, IP and data theft are difficult to detect and prevent. These processes should not be too onerous, as lab access comes in many forms, but consider differentiating between at least long-term access and ad hoc permissions for specific use cases.

Control resource sprawl and costs

In addition to their security benefits, documented processes should help ops teams track and remove developer access to dormant or unnecessary resources, which controls costs -- something that's critical in any preproduction environment. These labs do not directly help the company make money, as production infrastructure hosting live applications does, so the budget is often minimal. A preproduction environment benefits from automation, much like other IT setups do. Through a self-service model, developers can spin up and spin down resources at will, freeing up IT administrators to manage production workloads. Without proper precautions, however, development's freedom to create lab deployments can quickly drain resources and incur large bills.

Unused resources, particularly in the cloud, still cost money. Spin down environments when the developers and testers complete their jobs. Don't, however, just automatically delete all resources a developer owns when she leaves the lab, since some resources are shared across teams.

Enforce resource limits to stay within budget. Most modern on-premises IT systems, as well as public cloud platforms, offer tools to implement these controls.

Have a backup

Never overlook backups for preproduction environments, as a lost lab can mean testing processes come to a halt and a feature release goes past its planned release date.

The time required to recreate an identical lab from scratch can be significant and negatively affect a company's ability to develop and deliver services and products.

Dig Deeper on Systems automation and orchestration