Try new code with real traffic and no user impact, by copying requests or hiding the feature.
Shadow traffic copies real production requests to a new version of a service, and throws the new version's answers away. A dark launch ships new code or a new feature to production, but keeps it hidden from users. Both let you test with real conditions and no user impact.
Tests with made-up data miss what real traffic does: odd inputs, weird sequences, huge spikes. A canary release shows the new version to real users, which finds problems, but some users are hurt while you learn. Shadow traffic and dark launches try to learn first and expose nobody.
Shadow traffic (also called traffic mirroring or replay): the proxy or gateway sends each request to the current version (v1) and also sends a copy to v2. The user receives v1's response. v2's response is only compared with v1's and logged, then dropped. You look for different answers, errors and slower responses.
Dark launch is a wider idea. You deploy the new code or feature to production, but hide it behind a flag, so no user can see it. You then use it quietly: run it on internal users first, call it in the background and compare its results, or double-write to a new database while still reading from the old one.
| Technique | Who sees the new version? | What you learn | Risk to users |
|---|---|---|---|
| Shadow / mirror traffic | Nobody. A copy runs and is dropped | Different answers, errors, latency | None, if side effects are blocked |
| Dark launch (hidden feature) | Nobody, or only staff | Whether the code works in production | Very low |
| Dark reads and writes | Nobody. Extra reads or writes go to a new store | Whether the new store matches the old | Low, if the old store stays the source of truth |
| Canary release | A small slice of real users | How real users and metrics react | Some users could be hurt |
A fixed list of ten requests, so the same settings always tell the same story. Real tools (Envoy or Istio mirroring, GoReplay) copy live traffic and compare responses automatically.
POST /payments without stubbing the effect can charge a customer twice.| Term | Meaning in easy words |
|---|---|
| Shadow traffic | A copy of real requests sent to a new version, with its answers dropped |
| Traffic mirroring | Another name for shadow traffic, used by proxies and meshes |
| Traffic replay | Recording real requests and sending them later to another system |
| Dark launch | Releasing code or a feature to production while hiding it from users |
| Dark read / dark write | Reading from or writing to a new system in the background, and comparing |
| Double write | Writing every change to both the old and the new store during a migration |
| Response diff | A comparison of the old and new answers for the same request |
| Side effect | Anything that changes the outside world, such as a charge, email or database write |
| Idempotent | Safe to run more than once with the same result |
| Noise | Differences that do not matter, such as timestamps and random IDs |
| Source of truth | The one system whose data counts. Stays on the old side until you switch |
| Choice | We gain | We lose |
|---|---|---|
| Mirror 100% of traffic | Complete coverage | Double load, double risk of leaks |
| Mirror a sample | Cheaper and safer | Rare cases may be missed |
| Stub side effects | No duplicates | v2โs write path is not fully tested |
| Sandbox copy of the data | A realistic, safe test | Cost, and the copy goes stale |
| Shadow before canary | Fewer surprises for users | Slower rollout |