On-Demand Branch Environments: Scale Dev without the Cost
Spin up isolated, per-PR environments in seconds. Run only the services you changed and inherit the rest from a shared baseline — up to 90% cheaper than full clones.
How to Create Branch Environments
Spinning up a full, isolated stack for every Pull Request is prohibitively expensive and slow. MicroStax solves this with Branch Environments built on sparse overlays.
Instead of cloning your entire infrastructure, a Branch Environment instantiates only the services you've changed. Everything else is transparently routed to a stable Baseline.
1. Promote a stable Baseline
A baseline is a shared, read-only copy of your stack (typically your main or production branch) that provides the "backbone" for all developer branches.
microstax env promote production-cluster-01
2. Define your Override (Sparse Blueprint)
Your branch blueprint only needs to describe the services being modified. MicroStax automatically handles the wiring back to the baseline for all missing dependencies.
# branch-patch.yaml
name: feature-payment-v2
services:
payment-service:
image: ghcr.io/org/payments:feat-123
resources:
cpu: '250m'
memory: '512Mi'
3. Launch the Branch in Seconds
Use the overlay create command to sprout your environment. Because you aren't waiting for full databases or hundreds of pods to start, Branch Environments typically go live in under 5 seconds.
microstax overlay create --baseline production-cluster-01 --file ./branch-patch.yaml
Why use Branch Environments?
- 90% Cost Reduction: You only pay for the pods you actually change.
- Instant Start: No more waiting 10 minutes for a "full staging" environment.
- Frictionless Testing: Every PR gets its own URL and Jaeger traces without the operational overhead of a full cluster.
- Behavioral Parity: Since requests "fall back" to the baseline, you are always testing against the latest stable state of the rest of the system.
Next Steps
- Learn how to use Traffic Shadowing for real-world testing.
- Explore AI-Powered Diagnostics to debug branch discrepancies.
- View the Full CLI Reference.