Key Network Components

12 min read Β· Updated 2026-09-30

Modern web applications depend on a small set of critical networking components that provide scalability, fault tolerance, and global performance. This lesson covers the foundational pieces of distributed-systems networking: load balancers, API gateways, proxies, and CDNs.

Load Balancers

Load balancers distribute incoming traffic across multiple backend servers, providing horizontal scalability, fault tolerance, and reduced response times. They give clients a single entry point and automatically reroute traffic away from unhealthy servers.

Types by layer

DNS load balancing
Returns different IPs to different users (Route 53). Great for geographic distribution and simple failover. DNS caching can delay updates during outages.
Layer 4 (NLB)
IP + port only. Ultra-low latency, millions of requests per second. AWS NLB. Best when you don't need content-aware routing.
Layer 7 (ALB)
Inspects HTTP content for routing decisions. Path-based routing, host-based routing, sticky sessions via cookies. AWS ALB, NGINX, HAProxy. Standard choice for HTTP traffic.
ECMP
Network-layer load balancing across equal-cost paths. Used inside data centers when you need to spread traffic across multiple network links.

Algorithms

Static
Predefined rules
Round-robin, weighted round-robin, hash-based. Simple, predictable. Don't adapt to actual server state.
Dynamic
Adapt to current load
Least connections, least response time, least loaded. Better outcomes, slightly more overhead. The right default for variable workloads.

How each algorithm picks

AlgorithmSelection ruleWhere it goes wrong
Round-robinCycle server 1, server 2, server 3, then back to 1Fair only when servers have similar capacity and requests cost about the same
Weighted round-robinA weight of 3 receives three times the requests of a weight of 1The weight is static. A large server that is already saturated still receives its share
Hash of client IP or session idThe same key maps to the same serverA hot key pins one server. Adding or removing a server remaps keys unless the hash is consistent
Least connectionsChoose the server with the fewest active connectionsRight when request duration varies. Few connections can still mean a slow server
Least response timeFewest connections, biased by recent response speedThe latency sample lags. Traffic keeps arriving at a server that just got worse
Least loadedCPU and memory, not connection countThe metric lags a burst. The sample you route on is already stale

Sticky sessions

Some apps need a user to stay on the same backend (because session state lives there). Two approaches:

The better long-term answer is to externalize session state (Redis, JWT) so any backend can serve any request.

Production essentials

Health checks
Continuous HTTP/TCP probes detect unhealthy servers within seconds; traffic gets rerouted automatically.
TLS termination
Decrypt at the LB; pass plain HTTP to backends inside the trusted network. Centralizes cert management.
DDoS protection + rate limiting
Filter at the edge before traffic reaches your services. Most cloud LBs integrate with WAFs.
Caching
Modern LBs can cache frequently requested responses, reducing backend load.

API Gateways

While load balancers distribute requests across identical servers, API gateways manage API complexity in distributed architectures. They make intelligent routing decisions based on request characteristics β€” /users/profile to user services, /orders/history to order services β€” and handle cross-cutting concerns.

Load balancer
Distribute among identical instances
Knows nothing about what services exist. Just spreads load. Layer 4 or 7. Pure traffic distribution.
API gateway
Route by request semantics
Routes based on URL paths, headers, or content. Centralizes auth, rate limiting, transformation, observability. Knows your service topology.

What gateways add

Centralized security
OAuth flows, JWT validation, API keys, RBAC β€” all at the gateway, not duplicated per service.
Rate limiting
Per-tenant, per-endpoint, per-tier quotas. Free tier 300 req / 15 min; enterprise unlimited. Configured once.
Transformation
Protocol translation (REST↔GraphQL), data format conversion, API versioning shims. Backward compatibility without backend changes.
Monitoring
Usage patterns, popular endpoints, error rates, latency bottlenecks β€” visible at one place before they affect users.

Choosing one

For most multi-tenant SaaS platforms, a managed cloud gateway in front of an internal service mesh is the pragmatic combination.

Proxies

A proxy is any service that sits between clients and servers and forwards requests. Two main flavors:

Forward proxy
Sits in front of clients
Clients send requests through it. Used for outbound filtering (corporate firewalls), caching (Squid), anonymization (Tor), regional access.
Reverse proxy
Sits in front of servers
Clients hit the proxy thinking it's the server. NGINX, Apache, Cloudflare. Used for SSL termination, caching, load balancing, header manipulation.

The line between reverse proxy and load balancer is blurry β€” most reverse proxies (NGINX, HAProxy) can do load balancing, and most load balancers proxy. The distinction is mostly historical.

Debugging proxies such as Charles and Burp, and a hosted filter such as Zscaler, are forward proxies too. To the origin, every user is the proxy. Without a second instance that hop is a single point of failure.

A reverse proxy can also compress responses, hide backend addresses, and write one access log for the whole front door. Every byte passes through it, so an undersized proxy caps the application behind it.

AWS splits the managed balancer into ALB for Layer 7 HTTP, NLB for Layer 4 at high packet rates, and Classic Load Balancer, which new designs should leave. Kubernetes uses a Service for balance inside the cluster and an Ingress controller for external HTTP, often provisioning the cloud load balancer from the manifest.

CDN (Content Delivery Networks)

A CDN is a globally distributed network of servers that cache content close to users. Foundational for any application with a global user base.

Edge presence
100s of points of presence (PoPs) worldwide. Users hit the closest one. Static content arrives in milliseconds, not seconds.
Cache hierarchy
Edge β†’ regional β†’ origin. Repeated requests served from cache; only cache misses hit your backend.
DDoS absorption
CDN PoPs absorb traffic spikes that would overwhelm your origin. Attack traffic dies at the edge.
TLS / HTTP/3 termination
CDN handles TLS handshake at the edge β€” clients see the lower latency, your origin sees fewer connections.
Origin shield
Optional layer between edge and origin to coalesce origin requests. Especially useful for popular content.
Edge compute
Run code at the edge (Cloudflare Workers, AWS Lambda@Edge). Personalization, A/B tests, auth checks without going to origin.

Caching strategies

For SaaS apps, the practical answer is: serve all static assets through a CDN, cache aggressively, and use short cache lifetimes (or signed URLs) for tenant-specific assets.

A Tokyo client fetching an image from a New York origin adds hundreds of milliseconds of fiber. An edge in Japan serves the object or pulls it from a regional cache, typically a 50 to 80 percent latency cut on media-heavy pages. Static files can stay cached a long time; personalized responses get a short lifetime or none. The CDN bill grows with traffic, and the origin still has to absorb a burst of simultaneous misses.

Auxiliary Infrastructure

A few other components that round out the networking story:

DNS
Domain β†’ IP resolution. Modern DNS providers (Route 53, Cloudflare, NS1) offer health checks, geographic routing, weighted records.
WAF
Web Application Firewall. Filters common attacks (OWASP Top 10) at the edge. Cloudflare WAF, AWS WAF, F5 ASM.
VPN / Direct Connect
Private connectivity between on-prem and cloud. AWS Direct Connect, Azure ExpressRoute. Used for hybrid setups and compliance.
Service mesh
Istio, Linkerd, Consul Connect. Network-level concerns (mTLS, retries, circuit breakers, observability) for service-to-service traffic. Next lesson goes deep on this.

Putting It Together

A typical SaaS request flow:

[ User ]
    β”‚
    β”‚ DNS lookup (Route 53)
    β–Ό
[ CDN edge (Cloudflare) ]
    β”‚ TLS termination, edge cache, WAF
    β–Ό
[ Cloud Load Balancer (ALB) ]
    β”‚ Layer 7 routing, health checks
    β–Ό
[ API Gateway (Kong) ]
    β”‚ Auth, rate limiting, request transformation
    β–Ό
[ Service Mesh (Istio) ]
    β”‚ mTLS, retries, circuit breaker
    β–Ό
[ Microservice ]

Each component has a job. Each job exists because moving it to the next-most-natural location either costs more or gives less control.

Recap