โ† Back to microservices patterns map
๐Ÿ‘ป
Microservices Pattern

Shadow / Mirror Deployment

Mirror production traffic to a new version, but discard shadow responses.

deploy

Detailed Description

Shadow traffic helps test correctness and performance under real request patterns without impacting users.

Use shadow-only guards to prevent writes, emails, payments, and other irreversible side effects.

Route mirrored requests with explicit context headers (for example x-shadow: true) and separate observability streams.

Use isolated dependencies for shadow paths (DB, topics, external APIs) to avoid double writes and accidental side effects.

Shadow validates technical behavior; it does not validate user-visible UX outcomes.

Visual Diagram

User traffic -> v1 live
Mirror same request -> v2 shadow
Discard shadow response
Compare logs/metrics

Tradeoffs

Pros

Validates behavior on real traffic with zero user exposure

Cons

Risky side effects unless writes and external calls are isolated

Examples: NGINX mirror module, Envoy traffic shadowing, Istio mirror