How do you deploy a change that needs both a new API version and a new frontend at the same time?
AdvancedScenarioDeployments and releases
Answer
Situation read → You almost never can deploy two components atomically. Design so the order doesn't matter.
What I'd do →
- Make the backend backward compatible: add the new field or endpoint while keeping the old one. Deploy backend first.
- Deploy the frontend that uses the new API. Old cached frontends in browsers still work against the old contract.
- Gate the new user-facing behaviour behind a flag so it turns on when both sides are live.
- After traffic to the old endpoint drops to zero (check access logs or metrics), remove it in a later release.
- For mobile clients, keep old API versions alive much longer, since users don't update.
Why → Browsers, CDNs and mobile apps cache old clients for days. "Deploy both together" is a myth.
Interview tip → Mention CDN-cached JavaScript; it is why the frontend can't assume a fresh backend contract.
More on Deployments and releases
A deploy went out and p99 latency doubled. Walk me through it.IntermediateYou deployed a new version and half the pods are in CrashLoopBackOff. What do you do?BeginnerA release passed every test in staging but broke in production. How do you investigate?IntermediateHow would you design a zero-downtime deployment for a stateless API on Kubernetes?BeginnerEvery deploy causes a short spike of 502 errors from the ALB. Why, and how do you fix it?IntermediateHow would you set up a canary release, and what decides whether it gets promoted?Intermediate