Parallel run (shadow traffic)
Running the old and new implementation side by side on real requests, using the old result and comparing the new one, before switching over.
Tests cover the cases someone thought of; production traffic covers the rest. In a parallel run every request (or a sample) goes to both implementations, users get the old answer, and differences are logged. When the mismatch rate is understood and close to zero, the new path becomes primary. GitHub’s Scientist library made the pattern popular for refactoring critical paths; dark launching is the same idea for new features.
It is the safety net of a strangler fig migration, before the system of record moves. Shadow calls must not have side effects: the new path should not send emails, charge cards or write to shared tables. Switching over is then done gradually with feature flags or a canary release.
Sources
- GitHub: github/scientist github.com
- Martin Fowler: Dark Launching martinfowler.com
Related terms
- Strangler fig pattern: Replacing a legacy system piece by piece, routing one feature at a time to new code until the old system can be switched off.
- System of record (source of truth): The one system whose copy of a piece of data wins when copies disagree; all other copies are derived from it.
- Canary release: Sending a new version to a small share of traffic first, watching error rates and latency, and widening the rollout only if it holds.
- Feature flags: Switches in code that turn a feature on or off for some or all users without a new deploy.
- Branch by abstraction: Replacing a component inside a codebase step by step: put an interface in front of it, build the new version behind it, switch, then delete the old one.
