All posts
environment-managementself-serviceai-era-delivery

The Ideal Development Environment: 5 Ways to Give Developers and Their AI Agents a Place to Test

Shared, isolated, local, partially isolated or dependent: five ways to set up development environments, what each costs, and what AI agents change.

Anshul Sao
Anshul Sao
Mar 21, 2024 · 9 min read

Good software starts with a phase most people never see: repeated tests of a change before it reaches a shared environment. This phase lets a team try ideas in a risk-free place, without breaking integration test environments or production.

A dev environment is where that happens. This post compares five ways to set one up, what each one costs, and why the question has changed now that AI agents write a growing share of the code.

Why developers need their own environment

In our conversations with engineering teams, one gap comes up again and again. Most teams have test and quality assurance environments. Far fewer have a developer playground: a safe place to try a change without affecting the shared test environments or the live product. Two needs stand out:

  • Personal or team environments: developers and their teams want a private space to test and refine new or experimental features.
  • Feature environments: teams want environments built around one feature in progress, so several features can be tested in parallel without affecting each other.

Setting up these playgrounds for large or complex systems on a laptop is hard. That is why the choice of strategy matters. If the difference between a dev, test and staging environment is new to you, start with what a dev environment is.

What it costs when they do not have one

Organizations avoid extra environments for two reasons. The first is the operations burden: someone has to set up, support and update each environment. The second is cloud cost, which grows fast when environments are created without limits.

Not having them costs money in other ways:

  • Unstable integration environments: when developers cannot run basic checks, issues leak into integration, QA and staging, and waste everyone's time.
  • A longer feedback loop: developers find problems late, and each late discovery interrupts the next feature.
  • Higher lead time: the shared integration environment becomes a queue. Releases slow down.

Why AI makes it urgent

AI coding assistants changed the volume. Each engineer now sends more changes every week, and coding agents open pull requests of their own. Every one of those changes needs somewhere to run before it reaches a shared environment.

An agent also needs that place for a different reason. An AI agent can only run what it can verify. For code, the compiler and the unit tests give it that check. For a change that touches services, databases and configuration, the only real check is to run it in an environment that looks like production and read the result.

A shared integration environment cannot do this for many agents at once. One bad change breaks it for everyone. So the old playground question becomes a question of scale: one environment per developer used to be hard, and teams now need something close to one per change.

Five ways to set up developer environments

Teams choose from, or combine, the following five options.

1. Shared developer environment with Telepresence

All developers share one cloud environment. With Telepresence, a developer working on one service intercepts that service's traffic in the shared environment and sends it to the version on their laptop. They edit and run code locally, without a full CI run for each change.

Diagram of a shared developer environment with Telepresence. One cloud environment runs services S1, S2 and S3 and a database. Developer 2 runs a new version of S2 on their laptop. Telepresence sends the traffic for S2 from the shared environment to Developer 2's laptop, and the local S2 still reaches the shared database.

How local testing works depends on the kind of service:

Service typeHow it reaches its dependenciesLocal testing with a shared dev environment
Frontend apps (static SPAs, mobile apps)Calls a public API serverPoint the app at the shared environment. Nothing else changes.
REST or SOAP APIsSits behind a load balancer and calls other services, databases, caches and cloud resourcesTelepresence opens a two-way network proxy between the laptop and the cluster, so the service runs locally as if it were in the cluster
Private RPC servicesCalled by other services inside the clusterThe laptop becomes a sink: calls from other services in the shared environment reach the local version

Diagram of a Kubernetes cluster on AWS with a public API, a private service and a database. A local machine runs its own copy of the private service. Traffic from the public API is routed to the local copy, which still connects to the database in the cluster.

Two rules keep a shared environment usable:

  • Lease RPC sinks. Only one sink can be active for a private RPC service at a time. Developers lease the service in turn, so the team needs a simple way to coordinate who holds it.
  • Ship schema changes first. When features need different database schemas, design the schema change before the feature work and get it to QA first. Then features merge without conflicts.

The team keeps the shared environment stable: every service runs the same stable version as QA, and feature work happens locally until it is ready to merge.

  • Use it for: debugging integration issues and small patches. Developers do not need to run every dependency locally.
  • Watch for: large feature changes that break backward compatibility. They are hard to test in a shared space.
  • Cost: cloud costs stay controlled, because one environment serves many developers.

2. Multiple isolated environments

Each developer, or a small feature team, gets a fully isolated environment in the cloud, with its own services and resources.

Diagram of multiple isolated environments. Developer 1 and Developer 2 each have their own cloud environment with their own services and database, so their tests never meet.

  • Use it for: parallel testing of large or complex features.
  • Watch for: developers need a way to pick the subset of services they need and create the environment on their own.
  • Cost: high. Every environment runs its own copy of everything, and forgotten environments keep billing.

3. Local environments

Each developer builds a production-like environment on their own machine, with a deployment tool or a prepared Vagrant box. Services and databases are bundled together, and cloud services that cannot be bundled are mocked or used remotely. Lyft described this approach in detail in lyft-in-a-box.

Diagram of local environments. Three laptops each run their own copy of the services and a database, with no shared cloud environment.

  • Use it for: early stages, when there are few services and the databases are simple.
  • Watch for: setup is hard, and a laptop runs out of memory and CPU as the system grows. Local environments also drift from the cloud environments, so they need a regular refresh.
  • Cost: low.

4. Partially isolated environments

Teams share one cloud environment, and request headers decide which version of a service handles a request. A proxy such as Envoy, often as a sidecar, routes a request to the version under development.

Diagram of a partially isolated environment. One shared cloud environment runs S1, S2 and S3 and a database. A second version of S2, under development, runs next to the original. Header-based routing sends only the tagged requests to the new version.

  • Use it for: stateless microservices that several teams develop at once.
  • Watch for: header-based routing is hard to roll out across a whole system, and it does not suit services that share resources or need cache invalidation.
  • Cost: moderate.

5. Dependent environments

A dependent environment inherits a base environment, such as staging, with its live infrastructure. Only the services you change are deployed fresh. Everything else, including the cluster and the shared databases, comes from the base.

Diagram of a dependent environment. A base staging environment runs services S1, S2 and S3 and a database. A branch environment inherits all of it and deploys only a new version of S2. Its calls to S1, S3 and the database go to the inherited copies in staging.

  • Use it for: a branch or pull request that changes one or two services, and for many changes in parallel.
  • Watch for: the environment shares data with its base. A change that needs its own data, or a new schema, still needs the schema rule above or a fully isolated environment.
  • Cost: low to moderate. You pay for the changed services, not for a second copy of the stack.

Compare the options

Each option trades cost against isolation. The table sums it up:

FactorSharedMultiple isolatedPartially isolatedLocalDependent
Drift managementSimpleSimpleDifficultMost difficultSimple: inherits the base
Number of environmentsOne per teamOne per developerOne per teamOne per developerOne per branch or change
Setup complexityComplexEasyComplexEasiestEasy once environments come from one model
Cloud costModerate ($$)High ($$$$)Moderate ($$)Low ($)Low to moderate ($ to $$)
Works for an AI agent's changeRisky: one bad change affects everyoneYes, but costly at agent volumeOnly for stateless servicesLimited to what fits on one machineYes: isolated where it changed, cheap per change

Shared and isolated environments are easy to keep in sync with production. Partially isolated and local environments take more work to keep consistent. Dependent environments sit in between: isolated where the change is, shared everywhere else.

An environment as a request

Per-branch environments were hard for one reason: wiring. Each new environment needed routing, service discovery, databases and configuration set up by hand. When environments are declared instead, that wiring comes from the model.

How Facets does it

In Facets, every environment comes from one blueprint, and the platform team's module contracts apply in each one. So a short-lived environment for a branch is a request, not a project, for a developer and for a coding agent alike.

A dependent environment inherits a base environment's live infrastructure and deploys fresh only the services you name:

bash
raptor create environment pr-142 -p myproject --base-env staging \
--dedicated service/api --launch -w

Your AI assistant can ask for the same thing in plain words through the Praxis CLI. A short-lived environment tears itself down after a set time, so test environments do not linger. Leasing still helps when you only need one service on your laptop. Why Facets: Environments as a commodity explains the wider model.

How to choose

There is no single right answer. Ask four questions:

  1. How many services do you run? With a handful, local environments work. With dozens, they stop fitting on a laptop.
  2. How much state do services share? Queues, caches and schemas shared across services make partial isolation hard and favor isolated or dependent environments.
  3. What is the budget? Shared and dependent environments cost the least in the cloud. Fully isolated ones cost the most.
  4. Who needs the environment, a person or an agent? A person can coordinate a lease. Many agents working in parallel need environments they can create, use and remove on their own.

Most teams combine two or three options: local work for the inner loop, a shared environment for integration, and short-lived or dependent environments for changes that need a full system.

To see how teams build every environment from one blueprint, look at environment management or book a demo. For the thinking behind it, read Why Facets.

Read next: the environment lifecycle, from create to delete and developer experience.

Frequently asked questions

Tags

#developer-experience#developer-environments