Cross-AZ Traffic Costs in AWS (Spring Boot & React Architectures)

Hidden Network Spend in Spring Boot + React Architectures

This article is part of the AWS Cost Optimization series, specifically the section on Network & Data Transfer Costs.

After optimizing NAT Gateway costs, many engineering teams are surprised to see network costs still increasing. In most cases, the next hidden
driver is Cross-AZ traffic—especially in architectures built with React on the frontend and Spring Boot on the backend.

What is Cross-AZ Traffic (and why it costs money)

Cross-AZ traffic occurs when data flows from one Availability Zone (AZ) to another AZ within the same AWS region.

For example:

  • A request enters AZ-A but is processed in AZ-B
  • An application in AZ-A queries a database in AZ-C

Even though everything is in the same region, AWS charges for data leaving one AZ and entering another.

Why Spring Boot + React architectures hit Cross-AZ costs easily

A typical modern architecture looks like this:

User → CloudFront → ALB → Spring Boot APIs → Databases / Caches

React frontends tend to generate many API calls. Spring Boot backends are often chatty and make multiple internal and database calls per request.

When load balancing and scaling happen across Availability Zones, Cross-AZ traffic becomes very easy to create—often without anyone explicitly designing for it.

Common Cross-AZ traffic patterns in real systems

ALB to Spring Boot across Availability Zones

An Application Load Balancer may receive a request in AZ-A but forward it to a Spring Boot instance or pod running in AZ-B.

This happens by default when cross-zone load balancing is enabled and targets are not AZ-aware.

Spring Boot to Spring Boot (internal APIs)

In microservice architectures, service-to-service calls often cross Availability Zones. This east–west traffic is invisible to users but very visible on the AWS bill.

Spring Boot to databases and caches

If an application runs in one AZ while its database or cache runs in another, every query becomes Cross-AZ traffic.

This often happens due to misunderstandings around RDS Multi-AZ or cache cluster placement.

Why Cross-AZ costs are hard to spot in AWS billing

Cross-AZ traffic usually appears as generic Data Transfer charges in AWS billing. It is not clearly attributed to ALB, EKS, or RDS. As a result, teams often see increasing network costs without an obvious source.

Cross-AZ traffic and NAT Gateway: a dangerous cost multiplier

Cross-AZ traffic becomes especially expensive when combined with NAT Gateway usage. If traffic crosses AZs before reaching a NAT Gateway, both Cross-AZ transfer and NAT data processing costs apply.

For a detailed breakdown of this cost pattern in multi-account environments, see NAT Gateway costs in multi-account AWS data platforms.

How to detect Cross-AZ traffic in practice

Use AWS Cost Explorer and filter by usage types containing DataTransfer. Compare these charges with service-level network metrics from ALB, EKS, or EC2.

If data transfer costs increase while internet traffic remains low, Cross-AZ traffic is a likely cause.

How to reduce Cross-AZ traffic without breaking availability

ALB and load balancing considerations

Review cross-zone load balancing settings carefully. Prefer same-AZ routing where possible, but never disable cross-zone load balancing without understanding availability implications.

EKS and pod placement for Spring Boot

Ensure nodes and pods are evenly distributed across Availability Zones. Avoid situations where most traffic is handled by a single AZ, which forces Cross-AZ communication.

Aligning application and data placement

Keep steady-state traffic within the same AZ whenever possible. Allow Cross-AZ access primarily for failover scenarios.

React does not cause Cross-AZ costs (but can amplify them)

React applications themselves do not create Cross-AZ traffic. However, frequent frontend API calls can amplify backend network inefficiencies if placement is not optimized.

Trade-offs: cost optimization vs high availability

Do not sacrifice Multi-AZ resilience to save small amounts of cost. Optimize steady-state traffic, not failure or disaster paths.

Cross-AZ cost optimization checklist

  • Review ALB cross-zone behavior
  • Ensure Spring Boot services are evenly distributed across AZs
  • Minimize unnecessary Cross-AZ internal calls
  • Align databases and caches with compute in steady state
  • Review Data Transfer costs regularly

Part of the AWS Cost Optimization series