Traffic Mirroring (Shadowing)
You'll learn how to safely test new application versions by duplicating live traffic to a test environment without affecting real users.
What is Traffic Mirroring?
Traffic mirroring, also called shadowing, is a service mesh technique that sends a copy of production traffic to a separate service or version while letting the original request proceed normally to production. Think of it like carbon copy (CC) on an email—the real recipient gets the message and acts on it, while someone else gets an identical copy just to observe.
Unlike canary deployments where a percentage of real users hit your new version, mirroring sends duplicated requests to your test environment. Real users always interact with the stable production version, so there's zero risk to user experience.
How It Works
Your service mesh intercepts incoming production requests and creates a duplicate. The original request goes to production as usual, and the user receives that response. Simultaneously, the mesh sends a copy to your new version, but discards its response. You observe the shadowed version's behavior—logs, metrics, errors, latency—without it affecting anyone.
This is perfect for validating:
- New code under realistic load patterns
- Performance characteristics with actual data
- Error rates before full rollout
- Database query patterns
Common Use Cases
Load testing with real traffic patterns that you can't simulate artificially. Pre-production validation where your staging environment processes actual request shapes. Gradual confidence building before progressing to canary or blue-green deployments.
Key Takeaway: Traffic mirroring lets you test new versions with real production traffic patterns while maintaining zero risk to users, making it the safest first step in progressive deployment strategies.