Operations 19 min read

How to Achieve Zero‑Downtime Application Deployments with Service Routing and Load Balancers

This article explains why traditional application releases cause downtime, introduces maturity levels for nonstop deployment, compares release patterns, details essential technical components such as load balancers and service registries, and provides step‑by‑step graceful‑shutdown procedures using Spring Boot Actuator and Eureka.

dbaplus Community
dbaplus Community
dbaplus Community
How to Achieve Zero‑Downtime Application Deployments with Service Routing and Load Balancers

Application Release Overview

Application release is the process of deploying a fully developed feature to the production environment so that end‑users can access it. The traditional three‑step release consists of stopping the application, updating the binaries, and starting the application again.

Why Zero‑Downtime Releases Matter

During the stop‑start window users may encounter blank pages or time‑outs. Historically many teams scheduled releases at night and displayed a maintenance notice because traffic was low. Modern internet‑scale services require 24/7 availability, high user experience, and self‑service portals, making any downtime costly both to users and to the business.

Maturity Levels for Non‑Stop Release

Level 1: The service remains uninterrupted throughout the entire release.

Level 2: The service stays uninterrupted, but individual application functions can be validated internally or with low traffic before going live.

Level 3: Multiple inter‑dependent functions stay uninterrupted, with internal or low‑traffic validation before full activation.

Progressing through these levels requires incremental improvements in infrastructure and operational practices.

Release Pattern Comparison

Common patterns that provide user‑transparent releases include blue‑green, rolling, and canary deployments. Each pattern has trade‑offs: blue‑green needs duplicate production resources, rolling requires careful coordination of instance updates, and canary relies on traffic routing capabilities.

Key Technical Components

Application Management Platform – orchestrates the release workflow and integrates other components.

Load Balancer (L4) – distributes traffic at the transport layer.

Load Balancer (L7) – routes traffic based on application‑level attributes.

Container/VM Platform – creates, updates, and destroys container or VM instances.

DNS System – manages domain registration, updates, and resolution.

Service Registry – registers, updates, and deregisters service instances for discovery.

These components must be designed to work together, especially in multi‑zone or isolated container clusters.

Service Routing Basics

Service routing can be classified as:

North‑South: client → L4 LB → L7 LB → service.

East‑West: client → service directly (bypassing load balancers).

Graceful Shutdown Strategies

Approach 1 – Up to 5 seconds interruption

Steps:

Enable the /shutdown actuator endpoint.

management:
  endpoint:
    shutdown:
      enabled: true
  endpoints:
    web:
      exposure:
        include: shutdown

Adjust Eureka client/server parameters to reduce the fetch interval (e.g., eureka.client.registry-fetch-interval-seconds=5).

Before destroying a container or updating a VM, invoke the shutdown endpoint:

curl -X http://application-address/actuator/shutdown

Approach 2 – No interruption (no consumer notification)

Steps:

Expose both /shutdown and /service-registry endpoints.

management:
  endpoint:
    shutdown:
      enabled: true
  endpoints:
    web:
      exposure:
        include: shutdown,service-registry

Adjust Eureka parameters as in Approach 1.

Mark the instance as DOWN without removing it from the registry:

curl -X http://application-address/actuator/service-registry?status=DOWN

After the Eureka fetch interval (default 5 seconds), call the shutdown endpoint:

curl -X http://application-address/actuator/shutdown

Approach 3 – No interruption with consumer notification

Steps are similar to Approach 2, but before shutting down the instance you actively notify all consumers (e.g., via the service registry) to refresh their instance list, then invoke the shutdown endpoint.

Choose the method that balances acceptable brief interruption against implementation effort.

Development Compatibility Guidelines

API

Allow new fields with default values for required ones.

Permit length extensions or additional enumeration values for existing fields.

Never change the semantics, format, or delete existing fields.

If incompatibility is unavoidable, introduce a new API version and deprecate the old version only after all clients have migrated.

Database

Apply the same rules as for APIs to table columns.

When a schema change cannot be backward compatible, create new tables, migrate data, and keep the old tables until they are fully deprecated.

Messaging

Prefer formats that are compatible between old and new producers/consumers.

If incompatibility is inevitable, agree on a new topic; existing producers can continue on the old topic while consumers add a translation layer.

Cache

Prefer cache structures that remain compatible across versions.

If incompatibility arises, handle the divergent business logic with special processing paths.

Conclusion

Zero‑downtime releases require a mature infrastructure (load balancers, service registries, container/VM platforms), a clear service‑routing design (north‑south vs. east‑west), and disciplined development practices that guarantee backward compatibility for APIs, databases, messaging, and caches. By selecting an appropriate graceful‑shutdown strategy and following the compatibility guidelines, teams can minimize user impact while maintaining rapid, reliable delivery of new functionality.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

MicroservicesDeploymentSpring Bootservice routingeurekaZero DowntimeLoad Balancer
dbaplus Community
Written by

dbaplus Community

Enterprise-level professional community for Database, BigData, and AIOps. Daily original articles, weekly online tech talks, monthly offline salons, and quarterly XCOPS&DAMS conferences—delivered by industry experts.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.