edgeacademyCUSTOMER ENGINEERING
MODULE 03 · LESSON 3 OF 5

Load balancing, NAT, and segmentation

12 min read · Sources linked below

Theory and industry practice are explained below. Cloudflare-specific behavior links to official documentation. Customer examples are hypothetical.

Learning objectives

  • Separate load balancing, NAT, and segmentation
  • Design meaningful health checks
  • Trace state and return-path failures

The mental model

Load balancing distributes work across available service instances. NAT translates addresses or ports between network contexts. Segmentation limits which systems can communicate. These mechanisms often coexist, but each solves a different problem. A load balancer does not automatically make a database highly available. NAT does not prove that an application is authorized to receive traffic. A subnet diagram does not enforce segmentation by itself. Customers benefit when these responsibilities are explicit: routing delivers the packet, policy permits the flow, and a healthy application serves the request. When any one of those assumptions is wrong, the others may look healthy while users still fail.

How it works

A load-balancing design specifies the selection algorithm, health signal, session behavior, and failure action. A basic TCP health check can confirm a listening port while missing a broken dependency. An application-aware check is more representative but can also mark every endpoint unhealthy if it depends on one shared service. Define what healthy means for the customer journey and avoid a check that amplifies a dependency incident.

NAT changes address information, often maintaining translation state for return traffic. Port exhaustion, asymmetric routing, or expired mappings can break connections even when the destination is reachable. Source translation can also reduce the visibility of original clients unless application or proxy metadata is handled correctly and trusted appropriately. Segmentation should express explicit allowed flows between roles, such as web-to-API and API-to-database, with logging for denied traffic. During diagnosis, inspect the original and translated tuple, selected backend, health status, policy decision, and return path. These are independent observations. For migration, test failover and connection draining as well as ordinary requests, because a balanced steady-state system can still interrupt users during change.

Applied example · hypothetical

Hypothetical example: a SaaS API works for most requests but new connections fail during a burst. The load balancer reports healthy backends, so the team adds application instances. Failures persist because an outbound NAT device has exhausted available source ports for a downstream connection pattern. Connection metrics and translated-flow evidence reveal the bottleneck. The remedy may involve connection reuse, reducing unnecessary fan-out, or changing egress capacity and topology. The case illustrates why healthy servers and even traffic distribution do not prove the entire connection path has sufficient capacity.

In a customer engagement

When evaluating Cloudflare Load Balancing or enterprise routing, ask what health checks actually validate and how origin sessions behave during failover. Confirm the customer still has a correct return path and policy model. Explain that traffic steering is one part of resilience; shared databases, authentication services, and egress devices can remain single points of failure.

Interview relevance

An architecture interviewer may challenge a diagram by removing a backend or changing a route. Discuss health detection, connection state, draining, and shared dependencies. Show that you can distinguish capacity distribution from fault tolerance, and that you know source-address changes can affect both observability and policy decisions.

Common mistakes

  • Treating NAT as a complete security boundary
  • Using a shallow check as proof of application health
  • Ignoring connection draining during failover

Key terminology

Load balancing — Distributing requests or connections among service endpoints according to selection and health policies.

NAT — Translation of network addresses and sometimes ports between network contexts.

Segmentation — Enforced separation of network communication according to explicit policy.

Explain it without the page

  • What dependency should your health check include or deliberately exclude?
  • How could source NAT change a rate-limiting policy?

Further reading

Sources explain the underlying concepts; examples and practice answers are original course material. Recheck current limits and plan eligibility before a real proposal.