Spring Boot Multi-Region High Availability

Spring Boot Multi-Region High Availability An architecture diagram generated by Archify. HTTP Client Traffic · REST / X-Source-Region · Architecture component · Sync HTTP HTTP Client Traffic REST / X-Source-Region Sync HTTP Nginx Router · reverse proxy :8000 · Architecture component · HTTP router Nginx Router reverse proxy :8000 HTTP router app-us · Spring Boot :8080 · Region 1: us-east-1 (Primary Writer) · primary · Spring app-us Spring Boot :8080 primary postgres-us · Aurora Writer :5432 · Region 1: us-east-1 (Primary Writer) · active writer · PostgreSQL postgres-us Aurora Writer :5432 active writer rabbitmq-us · broker :5672 · Region 1: us-east-1 (Primary Writer) · Async Queue · RabbitMQ rabbitmq-us broker :5672 Async Queue app-eu · Spring Boot :8081 · Region 2: eu-west-1 (Secondary / DR) · secondary · Spring app-eu Spring Boot :8081 secondary postgres-eu · Aurora Reader :5432 · Region 2: eu-west-1 (Secondary / DR) · failover target · PostgreSQL postgres-eu Aurora Reader :5432 failover target rabbitmq-eu · broker :5672 · Region 2: eu-west-1 (Secondary / DR) · Async Queue · RabbitMQ rabbitmq-eu broker :5672 Async Queue HTTP REST X-Source-Region X-Source-Region reads + writes home reads cross-region writes storage replication AMQP listener (async) AMQP listener (async) Region 1: us-east-1 (Primary Writer) Region 2: eu-west-1 (Secondary / DR)

Synchronous HTTP Flow

  • • Inbound REST requests route through Nginx based on X-Source-Region header
  • • Home reads stay local; follow-the-sun mutations route to the authoritative global writer

Asynchronous Queue Flow

  • • AMQP events publish to regional RabbitMQ with local consumer listener containers
  • • Isolated message processing per region with automatic retry queues (TTL) and DLQ

DR Queue Lease Coordination

  • • Queue failover is governed by PostgreSQL lease coordination (queue_region_status), not Nginx
  • • Surviving region spins up dynamic takeover listeners to drain remote brother queues
📍 Case 1: Aurora HA (Single Writer)⚡ Case 2: Cassandra (Active-Active)🔄 HTTP Sync vs Queue Async Flows