QA
Senior LevelREST APIs & Web Services

How do API Gateways execute Canary Deployments with weighted percentage traffic splitting?

❓ Interview Prompt: Explain Canary Deployments, API Gateway weighted routing, header-based routing, real-time error rate telemetry monitoring, and automated rollbacks.

Canary Deployments minimize release risk by routing a small fraction of live production traffic to a new version ('v2') while monitoring error rates before rolling out globally:

Execution Strategy:

1
Weighted Routing: API Gateway routes 95% of traffic to 'v1' and 5% to 'v2'.
2
Header-Based Targeting: Internal QA testers pass header 'X-Canary-Target: true' to force routing to 'v2'.
3
Automated Rollback: Telemetry monitors '5xx' error rates and latency on 'v2'. If errors exceed 0.5%, gateway automatically shifts 100% traffic back to 'v1' instantly!

Code Implementation Example

yaml
# Istio VirtualService Weighted Canary Routing
spec:
  hosts:
    - api.example.com
  http:
    - route:
        - destination:
            host: user-service-v1
          weight: 95
        - destination:
            host: user-service-v2
          weight: 5
💡Istio VirtualService weighted canary routing configuration (95% v1 / 5% v2).
🎯 Interview Key Takeaway

Execute canary deployments using API Gateway weighted traffic splitting coupled with automated telemetry error rollback.

#Canary Deployments#API Gateway#Istio#Senior
Back to all REST APIs & Web Services Questions→

More REST APIs & Web Services Interview Questions

Beginner LevelREST APIs & Web Services

What is HTTP Method Idempotency and how do you implement Idempotency Keys for REST APIs?

Beginner LevelREST APIs & Web Services

What are standard HTTP Status Codes (200, 201, 204, 400, 401, 403, 404, 409, 429, 500, 503)?

Beginner LevelREST APIs & Web Services

What are HTTP Verbs (GET, POST, PUT, PATCH, DELETE) and when to use PUT vs PATCH?