Skip to content
Latchkey

What Is Shadow Traffic?

Shadow traffic (or traffic mirroring) sends a copy of real production requests to a new version of a service while discarding its responses, so you can test under real load with zero user impact.

Shadow traffic lets you put a new version through its paces using genuine production requests, without those requests depending on it. The new version sees real traffic patterns, but users never see its output -- giving you a realistic dress rehearsal with no risk to the live experience.

How mirroring works

A proxy or service mesh duplicates incoming requests: the original goes to the live service as usual, and a copy is sent to the shadow version. The shadow processes the request but its response is thrown away. Users are served entirely by the real version and never affected by the shadow.

What it tests

Shadow traffic validates how a new version handles real-world request shapes, volumes, and edge cases that synthetic tests miss. You can compare its outputs, latency, and resource usage against the current version under authentic load, surfacing problems before any user is exposed.

Watching for side effects

The biggest hazard is side effects. If the shadow version writes to a database, sends emails, or calls a payment API, it can cause real-world consequences from traffic that was supposed to be invisible. Shadowing requires careful isolation of writes and external calls to stay truly harmless.

Comparing responses

A powerful use is response comparison: run the old and new code on the same real request and diff the outputs. Mismatches reveal behavioral regressions you would otherwise only find in production. This makes shadow traffic an excellent way to validate risky refactors of critical paths.

Where it fits

Shadow traffic is a form of dark launching focused on the backend. It is especially valuable for performance and correctness validation of new service versions, complementing canary releases -- which expose real users -- by letting you test exhaustively before exposing anyone at all.

Key takeaways

  • Shadow traffic mirrors real requests to a new version and discards its responses.
  • It tests real-world load and correctness with zero user impact.
  • You must isolate side effects so mirrored requests cause no real consequences.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →