Layer 7 Load Balancer
Definition
Load balancer that works at the application layer, routing traffic based on content like URLs, headers, and cookies for optimized performance.
Use Cases
- Netflix: Route API traffic to different backend services and versions while supporting high-scale, global client traffic. — Netflix has publicly described using an edge/gateway layer and API routing patterns (often implemented with L7 proxies/load balancers) to direct requests to appropriate microservices based on HTTP attributes such as paths and headers, enabling service decomposition and controlled rollouts. (Improved scalability and resilience for a microservices architecture, with the ability to evolve services independently and manage traffic during deployments.)
- Airbnb: Front door for web and API traffic with routing to multiple internal services and safer deployments. — Airbnb has publicly discussed using an edge proxy/API gateway approach (commonly built on L7 reverse proxies) to route HTTP requests to internal services, apply request policies, and support gradual rollouts. (More reliable request routing and operational control (traffic management and safer releases) as the platform scaled.)
Provider Equivalents
- AWS: Elastic Load Balancing - Application Load Balancer (ALB)
- Azure: Azure Application Gateway
- GCP: Google Cloud HTTP(S) Load Balancing
- OCI: OCI Load Balancer (HTTP/HTTPS listener)
Frequently Asked Questions
- What's the difference between a Layer 7 load balancer and a Layer 4 load balancer?
- A Layer 7 load balancer understands HTTP/HTTPS and can route based on content like URL paths (/api vs /images), hostnames (api.example.com), headers, and cookies. A Layer 4 load balancer only sees network/transport details (IP, port, TCP/UDP) and typically routes without looking inside the HTTP request. Layer 7 enables smarter routing and features like redirects and WAF integration, while Layer 4 is often simpler and can be lower latency.
- When should I use a Layer 7 load balancer?
- Use it when you need application-aware routing or controls, such as path/host-based routing, blue/green or canary releases using headers/cookies, TLS termination, centralized authentication, or integrating a web application firewall. It’s also useful when multiple services share the same domain and you want one entry point that routes requests to different backends.
- How much does a Layer 7 load balancer cost?
- Cost usually depends on (1) hours the load balancer runs, (2) how much traffic it processes (bytes/requests), and (3) enabled features (TLS termination, WAF, advanced routing, global vs regional). Cloud providers price these differently (for example, AWS ALB uses hourly plus LCU consumption; GCP HTTP(S) Load Balancing is based on forwarding rules and data processed; Azure Application Gateway pricing depends on SKU/capacity units and data; OCI charges for load balancer instances and bandwidth). The biggest cost drivers are sustained throughput, high request rates, and add-ons like WAF.
Category: networking
Difficulty: advanced
Related Terms
See Also