Skip to content
Ship It
Strategies/Traffic layer

Shadow

Mirror real traffic to the new version. Users never see it.

Also called traffic mirroring or a dark launch. The new version runs next to the old one and receives a copy of every live request. Users only ever get the old version's response. The new one's is logged, compared and thrown away. It's the only strategy where a bug in v2 costs users nothing, and it tests the new version under real production load.

USERSROUTINGPODSMeshv2: 0%v1SERVINGv1SERVINGv1SERVINGv1SERVING
0.0s / 18s

Step 1 of 5: v1 serves everyone. Normal traffic, one version.

Availability
100%
No downtime
Pods running
1.00×
Peak 1.00× of normal
Blast radius
—
Inject a bug to measure
Time to recover
—
No incident
Shadow traffic0 requests mirrored0 failed on v2Users affected: 0
v1 (current)v2 (new)StartingIdle or shadow (no user traffic)Mirrored copySucceededFailed

Trade-offs

More filled is better for you
Uptime during deploy
4 out of 4.Users only touch v1
Low infra cost
0 out of 4.~2× plus duplicated load
Rollback speed
4 out of 4.Nothing to roll back
Small blast radius
4 out of 4.Zero user exposure
Simplicity
0 out of 4.Mesh, side-effect isolation, diffing
One version at a time
3 out of 4.Users only see v1

Pros and cons

Pros

  • Zero user impact, even if v2 is completely broken.
  • Real production traffic: real payloads, real concurrency, real edge cases.
  • Great for rewrites, migrations and performance work. Compare responses and latency side by side.

Cons

  • Side effects are the trap. Mirrored writes, payments and emails will happen twice unless v2 is isolated or stubbed.
  • Doubles load on v2 and on any downstream it calls.
  • It doesn't release anything. You still need another strategy to go live.
  • Comparing responses (diffing) is its own engineering project.

When to reach for it

Use it when

  • Rewriting a service or migrating to a new stack and you need identical behaviour.
  • Validating performance and capacity under real load before launch.
  • Read-heavy or idempotent endpoints.

Avoid it when

  • Endpoints with side effects you can't safely duplicate or stub.
  • Tight budgets. You're running and loading two of everything.

How to do it

apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
  name: shop
spec:
  hosts: [shop]
  http:
    - route:
        - destination: { host: shop, subset: v1 }
          weight: 100
      mirror:
        host: shop
        subset: v2
      mirrorPercentage:
        value: 100.0

Gotchas

  • Mirrored requests are fire-and-forget. The mesh doesn't wait for or return v2's response, so v2's latency doesn't affect users.
  • Point v2 at sandboxed dependencies, or tag mirrored requests (e.g. a header) so downstreams can ignore them.
  • Mirror a percentage (mirrorPercentage) for expensive services instead of 100%.
  • Auth tokens and PII are copied too. Make sure v2's logging is held to the same standards.

Pairs well with