tezvyn:

Canary vs shadow deployments: use cases and requirements

Curated by the Tezvyn teamSource: launchdarkly.comadvanced
Canary vs shadow deployments: use cases and requirements

This tests whether you distinguish user-facing rollouts from invisible duplication. Canary routes some real users to new code to limit blast radius; shadow mirrors traffic to an isolated clone to test performance without user impact.

WHAT THIS TESTS: This question probes your ability to differentiate two advanced deployment patterns that both reduce risk but serve fundamentally different validation goals. Interviewers want to see that you understand traffic routing mechanics, infrastructure cost tradeoffs, and the distinction between testing with real users versus testing with real traffic in isolation. The underlying theme is whether you can select the right safety mechanism based on what you are trying to validate.

A GOOD ANSWER COVERS: First, define canary deployment as a technique that routes a small percentage of actual user traffic to the new version while the majority remains on the stable version, allowing you to monitor error rates, latency, and business metrics with a limited blast radius. Second, define shadow deployment as traffic mirroring that sends a copy of production requests to the new version without returning its responses to users, letting you test performance, resource consumption, and correctness at full scale without any user impact. Third, contrast infrastructure requirements: canary needs load balancers, routing rules, and observability tied to user sessions, whereas shadow needs duplicate compute capacity and careful isolation so that mirrored traffic does not trigger side effects like duplicate payments or notifications. Fourth, explain when to choose each: use canary when you need to validate user-facing behavior, feature semantics, or gradual rollout tolerance; use shadow when you need to validate performance under production load, detect race conditions, or benchmark infrastructure before any user sees the change. Fifth, mention that feature flags can decouple deployment from release for both strategies, reducing the need to stand up entirely duplicate environments.

COMMON WRONG ANSWERS: A major red flag is claiming that shadow deployments provide a rollback safety net for user-visible bugs; since shadow traffic never returns responses to users, it cannot validate user experience or catch UI defects. Another mistake is stating that canary testing gives you full performance characterization without user impact; in reality, canary exposes users to potential latency spikes or errors, so it carries user-facing risk that shadow avoids. Candidates also err by saying the infrastructure is identical for both; shadow typically requires double the compute to process mirrored traffic, while canary requires sophisticated routing and sticky session handling.

LIKELY FOLLOW-UPS: The interviewer may ask how you would handle database schema changes during a canary rollout, or how you prevent shadow traffic from corrupting production state. They might also ask you to compare cost profiles, or to sketch an architecture using feature flags instead of load balancer rules to achieve the same goals.

ONE CONCRETE EXAMPLE: Imagine migrating a payment service to a new framework. A shadow deployment would mirror checkout requests to the new service to measure latency and memory usage against the old service, discarding the responses so no real charges occur. Once performance is validated, a canary deployment would shift one percent of real checkout traffic to the new framework, monitoring payment success rates and refund rates before scaling to ten percent and beyond.

Source: launchdarkly.com

Read the original → launchdarkly.com

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

Canary vs shadow deployments: use cases and requirements · Tezvyn