TNS
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Microservices / Software Testing

Scale Microservices Testing Without Duplicating Environments

Traditional ephemeral microservices test environments create financial and operational complexity that sandbox-based environments can solve.
Apr 15th, 2025 9:00am by
Featued image for: Scale Microservices Testing Without Duplicating Environments
Featured image by Steve Johnson on Unsplash.

I’ve been talking with engineering leaders for years about the challenges of testing microservices, and one conversation keeps being repeated. It usually starts with something like: “We’ve built this amazing microservices architecture, but testing has become a nightmare.”

The Integration Testing Challenge

The promise of microservices is compelling — faster development cycles, better team autonomy and improved scalability. But this architectural approach introduces a significant testing challenge that many teams don’t fully appreciate until they’re knee-deep in it.

The reality is that local testing with mocked dependencies doesn’t provide sufficient confidence. These mocks drift from reality over time, leading to the dreaded “works on my machine” syndrome. Integration bugs often remain undiscovered until code reaches a shared environment with real dependencies, usually staging.

This creates a painful bottleneck. As one VP of engineering told me recently: “Our staging environment is like a crowded nightclub: Everyone wants in, capacity is limited and fights break out regularly over who gets access.”

The Ephemeral Environment Solution

To address these bottlenecks, many organizations have turned to ephemeral environments — on-demand, short-lived replicas of production where developers can test changes against real dependencies before merging code.

The typical implementation involves either creating separate Kubernetes namespaces or entire Kubernetes clusters, both containing all services, databases, message queues and other dependencies. Each developer gets their own isolated playground.

This solves the contention problem. But at what cost?

The Math of Traditional Ephemeral Environments

Let’s run some napkin math on what these environments actually cost. Whether using namespace isolation or separate clusters, the resource requirements remain similar since you’re duplicating all components in both models. I’ll use fairly conservative assumptions:

  • Team size: 100 developers, each needing one environment
  • Architecture complexity: 50 microservices
  • Resource requirements: Each microservice needs 2 vCPUs and 4GB RAM
  • Usage pattern: Environments active eight hours per day on weekdays only

On AWS, a t3.large instance (2 vCPU, 8GB) costs roughly $0.08/hour. Being conservative and assuming excellent bin-packing, we’d need at least 50 such instances per environment.

The annual calculation looks like this: $0.08/hour × 50 services × 100 developers × 8 hours × 5 days × 52 weeks = $832,000

Yes, you read that right. Over $800,000 annually in compute costs alone. Even with more conservative estimates and discount pricing, we’re still talking millions.

The operational burden of maintaining hundreds of ephemeral environments is enormous. Configuration drift, networking issues and resource constraints create constant headaches for platform teams. When something breaks, all development grinds to a halt.

Sandbox-Based Ephemeral Environments

There’s a fundamentally different approach to this problem that dramatically reduces both costs and operational complexity: tunable isolation through request routing in sandbox-based ephemeral environments.

When using Kubernetes with a service mesh like Istio or Linkerd, you can create a shared baseline environment with dynamic request routing. When a developer needs to test changes, they deploy only the services they’ve modified into the sandbox. Requests are routed to these services based on request headers, while unchanged services are shared across all sandboxes.

Comparison of traditional and sandbox approaches shows increased complexity in the traditional architecture

Source: Signadot

Let’s recalculate costs with this approach:

  1. Baseline environment: 50 services at $0.08/hour
  2. Developer sandboxes: On average, each developer modifies two services at a time

Annual costs: ($0.08/hour × 50 services × 1 baseline × 24 hours × 365 days) + ($0.08/hour × 2 services × 100 developers × 8 hours × 5 days × 52 weeks) = $35,040 + $33,280 = $68,320

That’s a 92% cost reduction compared to traditional ephemeral environments!

Traditional environments cost 92% more than sandbox environments

Source: Signadot

The Missing Factor: Operational Complexity

With traditional ephemeral environments (both namespace and cluster-based), your platform team becomes responsible for maintaining hundreds of replicas of your entire stack. Every configuration change, every database migration, every new service must be propagated across all environments. This creates an enormous maintenance burden that grows linearly with the number of developers.

In contrast, with the sandbox-based approach, you maintain only one baseline environment. This environment can be continuously updated through your existing CI/CD pipeline, ensuring it always reflects the current state of your main branch. The operational load stays nearly constant regardless of how many developers you add.

Real-World Impact

I recently spoke with a VP of platform engineering at a fintech company who had calculated the cost of traditional ephemeral environments at over $5 million annually. After transitioning to a sandbox-based approach, the company slashed infrastructure costs by over 85% and refocused its platform team on creating better developer experiences and tooling rather than just maintaining environments.

Another customer, a large software as a service (SaaS) provider, is planning to move away from operating its own data centers entirely, with one key factor being elimination of expensive duplicate testing environments through sandbox-based ephemeral environments.

Beyond cost savings, these companies saw significant improvements in developer productivity. Testing cycles shrank from hours to minutes, allowing developers to verify changes immediately rather than waiting for post-merge integration tests.

Conclusion

As microservice architectures continue to grow in complexity, the cost of traditional testing approaches grows unsustainably. Sandbox-based ephemeral environments offer a more efficient alternative that provides the benefits of real integration testing without the crippling infrastructure costs and operational burden.

For many organizations, this isn’t just about saving money — it’s about whether comprehensive integration testing is financially viable at all. When traditional approaches cost millions, many teams are forced to cut corners on testing, leading to quality issues and production incidents.

If you’re interested in seeing these concepts in action, check out our case study with Brex, which reduced infrastructure costs by 99% after implementing sandbox-based ephemeral environments. Its engineering team could finally scale testing to all developers without breaking the bank.

To dig into the technical implementation details of how service meshes enable sandbox-based ephemeral environments, read “Using Istio or Linkerd to Unlock Ephemeral Environments” for a deeper dive into the approach.

Created with Sketch.
TNS owner Insight Partners is an investor in: Real.
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.