# Zero-downtime ECS deploys

https://shubhamnagota.com/work/zero-downtime-ecs

Fixed the ALB and shutdown timing behind an outage on every release.

## Problem

Every deploy to ECS Fargate caused a recurring outage of about 10 seconds. For a payments API, that means failed requests on every release.

## What I built

I redesigned the release path so the load balancer, the shutting-down task and in-flight connections are coordinated.

Diagram (Safe task replacement on deploy): New task passes tuned health checks, then ALB deregisters the old task, then Connections drain, then App shuts down gracefully, then Old task stops.

- ALB target deregistration timing.
- Task-termination timing.
- Connection draining.
- Graceful shutdown in the application.
- Tuned health checks.

## Outcome

- The ~10s outage on every deploy went to zero.
