Skip to content
← All articles
6 min read

Zero downtime deployment small team architecture without Kubernetes

A dependable zero downtime deployment small team setup does not require Kubernetes or distributed cluster management. With a reverse proxy, container healthchecks, graceful shutdown handling, and expand-contract database migrations, a lean engineering team can release updates safely without dropping in-flight requests or causing service interruptions.

Why Kubernetes is often overhead for small teams

Container orchestrators introduce significant operational complexity: network overlays, control plane maintenance, declarative cluster state, and steep debugging overhead. For a small team with a monolithic backend or a few independent services, this complexity frequently causes more production incidents than it prevents.

A predictable deployment pipeline can run directly on standalone Linux hosts using Docker and a reverse proxy. The goal is not cluster federation; the goal is simply switching live HTTP traffic from an old container to a new container without dropping user requests.

Blue-green container switching behind a reverse proxy

The simplest zero-downtime architecture runs two container instances side by side: the active version and the candidate version. An edge reverse proxy, such as Nginx, Traefik, or Caddy, handles incoming TLS termination and forwards traffic to the currently active container port.

When a new release starts, your deployment script brings up the candidate container on an alternate local port. The proxy continues routing traffic to the old container until the new container passes all readiness criteria. Once verified, the proxy reloads its upstream configuration, routing new requests to the new container instantly.

  • Keep two isolated container slots, often referred to as blue and green.
  • Run both containers on the same host or across a paired application instance.
  • Reload proxy configuration without dropping established connections.
  • Leave the previous container running until the new version is verified under real traffic.

Healthchecks and readiness verification

A container that has started its process is not necessarily ready to handle traffic. If the proxy forwards requests while the application is still initializing database connection pools, parsing configuration files, or warming caches, users will see gateway errors.

Your application must expose a dedicated healthcheck endpoint that verifies essential dependencies before returning an OK status. The deployment script or proxy probes this endpoint repeatedly. Only after consecutive successful responses does the proxy switch incoming traffic.

Graceful shutdown and in-flight request draining

Switching proxy traffic stops new connections from reaching the old container, but requests already in progress must finish cleanly. Abruptly killing the old container terminates database transactions midway and returns broken HTTP responses to clients.

When receiving a termination signal such as SIGTERM, the backend application must stop accepting new connections, signal the proxy that it is retiring, and wait for active requests to complete within a configured timeout. Only after in-flight handlers have returned or the timeout expires should the process close database connections and exit.

Database migrations: the expand-contract pattern

Code can be swapped in seconds, but database schema changes are persistent. If a migration removes or renames a column while the old version of the application is still serving traffic, queries will fail immediately. For zero downtime, database changes must always remain backward-compatible.

The expand-contract pattern splits schema modifications into distinct deployment cycles:

  • Expand phase: add new tables, nullable columns, or dual-write triggers without modifying existing structures.
  • Application transition: deploy code that writes to both structures or reads from the new schema while falling back safely.
  • Contract phase: after all older application versions are decommissioned, run a subsequent migration to remove obsolete columns and temporary triggers.

Instant rollbacks without state corruption

Even with thorough pre-deployment checks, unexpected regressions can emerge under live production traffic. A reliable deployment process must allow returning to the previous version within seconds without rebuilding images or applying emergency hotfixes.

Because the previous container remains intact and the database schema is backward-compatible, a rollback requires only updating the reverse proxy upstream target back to the previous port and reloading. The previous application version immediately resumes processing traffic without downtime.

Questions

FAQ

Didn't find an answer — ask on the call or in Telegram.

Is a reverse proxy reload truly seamless for active client connections?

Yes. Reverse proxies such as Nginx or Caddy reload their upstream configuration without terminating existing worker processes. Established connections finish on the existing configuration, while all new incoming connections immediately route to the new upstream targets.

Can we use Docker Compose for zero-downtime releases?

Yes. You can define two identical service definitions or use project names to start the new container alongside the existing one, check its health endpoint, update the proxy upstream reference, and then stop the old service.

What should we do if an expand-contract database migration fails?

Because the expand step only introduces additive changes, such as new nullable columns or new tables, existing application queries continue functioning normally. If the migration script encounters an error, the deployment halts before any proxy traffic is switched.

Related service

Go backend development for business applications

We build the server side of web products and develop existing systems. Data, traffic and reliability requirements come first, so the architecture fits the work it needs to do.

Learn about the service
Other articles
Contact

Shall we discuss your task?

Thirty minutes on a call — and you understand the architecture, timeline and engagement format. No obligations.

Or message us on Telegram →Follow our Telegram channel →

Enter your Telegram or email so we can reply.

We reply within 15 minutes.