Senior LevelSystem Design & Architecture
How does Traffic Shadowing (Dark Traffic Mirroring) test new service versions in production?
β Interview Prompt: Explain Traffic Shadowing (Traffic Mirroring), dark launching, NGINX / Envoy request duplication, and zero-risk production testing.
Traffic Shadowing (Dark Traffic Mirroring) duplicates live production HTTP requests at the API Gateway layer and sends asynchronous copies to a new candidate microservice version:
Benefits:
β’
Test new service versions against real production traffic volume, edge cases, and payload patterns.
β’
Zero Risk: Shadow responses are discarded at the gateway layer and never returned to real users!
Code Implementation Example
yaml
# Envoy Route Configuration for Traffic Shadowing (Mirroring)
routes:
- match: { prefix: "/api/v1/orders" }
route:
cluster: order-service-v1 # Live Production Target
request_mirror_policies:
- cluster: order-service-v2-shadow # Shadow Target (Responses discarded!)
percentage: { numerator: 100 }π‘Envoy configuration duplicating production traffic for dark testing.
π― Interview Key Takeaway
Use Traffic Shadowing to test new microservice versions against live production traffic without impacting real users.
#System Design#Traffic Shadowing#Dark Launching#Envoy#Senior
Back to all System Design & Architecture Questionsβ