Summary:

  • Network Load Balancer operates at OSI Layer 4 for ultra-low latency TCP/UDP workloads, while Application Load Balancer functions at OSI Layer 7 with advanced HTTP routing capabilities.
  • AWS introduced significant 2025 features including ALB Target Optimizer for automatic concurrency management and NLB weighted target groups for granular traffic distribution.
  • Cost structures differ fundamentally. NLB charges based on Network Load Balancer Capacity Units (NLCUs) driven by connection volume and bandwidth, while ALB uses Load Balancer Capacity Units (LCUs) based on connection complexity, rule evaluations, and bytes processed.
  • Security implementations diverge with ALB offering TLS termination and JWT verification, whereas NLB provides TLS passthrough for end-to-end encryption requirements.
  • Decision criteria depend on protocol needs, latency tolerance, routing complexity, and whether your architecture requires content-aware traffic management.

Choosing between a network load balancer vs application load balancer represents one of the most consequential infrastructure decisions you will make when architecting distributed systems on AWS. The wrong choice can introduce unnecessary latency into latency-sensitive trading platforms, inflate monthly costs by thousands of dollars, or leave you without critical routing capabilities when your microservices architecture demands path-based traffic distribution. Understanding the ALB vs NLB key differences requires moving beyond surface-level protocol comparisons into the architectural trade-offs that senior engineers evaluate during production deployments alike.

The following diagram illustrates where each load balancer type operates within the OSI model and how traffic flows through each architecture.

nlb_alb_osi_layer_comparison
Network Load Balancer and Application Load Balancer positioning within the OSI model

Understanding the OSI layer distinction between NLB and ALB

The fundamental architectural difference between these load balancers stems from their operating layer within the OSI networking model. Network Load Balancer functions at Layer 4, the transport layer, where it makes routing decisions based exclusively on TCP and UDP connection data such as source IP, destination IP, and port numbers. This positioning means NLB never inspects packet payloads, enabling it to forward traffic with minimal processing overhead and sub-millisecond latency additions.

Application Load Balancer operates at Layer 7, the application layer, where it gains visibility into HTTP and HTTPS request content. This elevated position allows ALB to examine headers, cookies, query strings, and request paths before determining which target group should receive the traffic. The trade-off involves additional processing time as ALB must parse and interpret application-layer protocols, but this overhead enables sophisticated routing logic impossible at Layer 4.

Real-world context: Financial trading platforms and gaming backends typically mandate NLB because even 5-10ms of additional latency from Layer 7 inspection can impact user experience or regulatory compliance for order execution timing.

How Layer 4 vs Layer 7 load balancing affects routing decisions

Layer 4 load balancing uses a flow hash algorithm to distribute connections across healthy targets. NLB calculates this hash using the protocol, source IP, source port, destination IP, and destination port. This ensures that all packets belonging to the same TCP connection reach the same target. The approach provides connection persistence without requiring session cookies or application-layer awareness.

Layer 7 load balancing enables content-based routing that examines the actual request before forwarding. Consider the following routing capabilities exclusive to ALB:

  • Path-based routing: Direct /api/* requests to backend services while sending /static/* to CDN origins
  • Host-based routing: Route api.example.com and www.example.com to different target groups from a single load balancer
  • HTTP header routing: Send requests with specific custom headers to canary deployments
  • Query string routing: Direct requests containing ?version=2 to updated service versions

Understanding these routing paradigms establishes the foundation for evaluating protocol support differences between the two load balancer types.

Protocol support and traffic handling capabilities

Protocol support represents a critical differentiator that often determines which load balancer fits your architecture. NLB handles TCP, UDP, and TLS traffic, making it protocol-agnostic for any application that communicates over these transport protocols. This flexibility allows NLB to load balance non-HTTP workloads including database connections, custom binary protocols, IoT device communications, and real-time media streams.

ALB specializes in HTTP, HTTPS, HTTP/2, gRPC, and WebSocket protocols. For teams building modern microservices architectures using gRPC for inter-service communication, ALB provides native protocol understanding, including full support for HTTP/2 multiplexing and bi-directional streaming that NLB cannot offer.

Pro tip: When interviewing for senior positions, emphasize that NLB can technically handle HTTP traffic but loses all Layer 7 routing benefits. The protocol flows through unchanged, meaning you cannot implement path-based routing or header inspection.

QUIC protocol and emerging transport standards

NLB gained QUIC protocol support, enabling load balancing for applications using this UDP-based transport protocol that powers HTTP/3. Since QUIC operates over UDP, only NLB can properly handle QUIC traffic while maintaining connection persistence through its flow hash algorithm. Organizations migrating to HTTP/3 for improved mobile performance and reduced connection establishment latency must use NLB for their QUIC endpoints.

The protocol landscape continues evolving, and AWS has positioned NLB as the forward-compatible choice for emerging transport protocols. After clarifying protocol capabilities, examining performance characteristics reveals how these architectural differences translate into measurable system behavior.

Performance benchmarks and latency characteristics

Performance differences between NLB and ALB stem directly from their architectural positioning. NLB achieves sub-millisecond latency additions because it operates at the network layer without parsing application payloads. AWS documentation indicates NLB can handle millions of requests per second while maintaining consistent latency, making it suitable for latency-sensitive workloads where every millisecond impacts user experience or system correctness.

ALB introduces measurable latency overhead due to Layer 7 processing requirements. Typical ALB latency additions range from 5-50ms depending on request complexity, routing rule evaluation, and TLS termination overhead. However, this latency investment enables intelligent traffic distribution that can improve overall system performance by routing requests to optimal targets based on content characteristics.

nlb_alb_latency_benchmarks
Latency distribution comparison between NLB and ALB under production workloads

Throughput scaling and connection handling

NLB scales automatically to handle sudden traffic spikes without pre-warming requirements. The service provisions capacity in response to traffic patterns, though AWS recommends gradual traffic ramp-up for extremely large-scale deployments. NLB maintains millions of concurrent connections efficiently due to its stateless packet forwarding approach at Layer 4.

ALB connection handling involves more complex state management because it terminates client connections and establishes separate connections to targets. This architecture enables connection multiplexing and HTTP keep-alive optimization but requires more resources per connection. The following table compares key performance characteristics:

Performance metricNetwork Load BalancerApplication Load Balancer
Typical latency additionSub-millisecond5-50ms
Maximum requests per secondMillions (scales automatically)Hundreds of thousands
Connection persistenceFlow hash basedCookie or duration based
Pre-warming requiredNoRecommended for large spikes
Idle connection timeout350 seconds60 seconds (configurable)

Watch out: ALB idle timeout defaults can cause issues with long-polling applications. Ensure your target timeout exceeds the ALB idle timeout to prevent premature connection termination.

Performance characteristics establish baseline expectations, but recent AWS feature additions have significantly expanded capabilities for both load balancer types.

Recent AWS feature updates for 2025

AWS released substantial feature enhancements throughout 2025 that reshape the network load balancer vs application load balancer comparison. These updates address long-standing capability gaps and introduce new architectural possibilities for both load balancer types. Understanding these additions proves essential for System Design discussions and production architecture decisions.

ALB Target Optimizer and automatic concurrency management

ALB Target Optimizer represents a significant advancement in intelligent traffic distribution. This feature automatically adjusts request routing based on target capacity and current load, preventing individual targets from becoming overwhelmed during traffic spikes. Target Optimizer monitors response times and error rates, dynamically shifting traffic away from struggling instances before they impact user experience.

The auto concurrency capabilities allow ALB to manage request queuing at the load balancer level rather than relying on target-side rate limiting. This approach provides several advantages:

  1. Prevents cascade failures when individual targets experience resource exhaustion
  2. Enables graceful degradation during unexpected traffic surges
  3. Reduces the need for complex client-side retry logic
  4. Provides centralized visibility into concurrency patterns across target groups

NLB weighted target groups for traffic distribution

Network Load Balancers now support weighted target groups, enabling percentage-based traffic distribution across multiple target groups. This feature facilitates blue-green deployments and canary releases at Layer 4, capabilities previously exclusive to ALB. You can now direct 90% of TCP traffic to production targets while sending 10% to canary instances for validation.

Weighted target groups use the same flow hash algorithm for connection persistence while respecting weight distributions for new connections. This combination ensures existing connections remain stable during weight adjustments while new traffic follows updated distribution patterns.

Historical note: Before weighted target groups, NLB users implemented traffic splitting through DNS-based approaches or upstream proxy layers, adding complexity and potential failure points to their architectures.

URL and host header rewrite capabilities

ALB expanded its request manipulation capabilities with enhanced URL rewriting and host header modification. These features enable ALB to transform incoming requests before forwarding to targets, supporting scenarios like legacy URL migration, API versioning, and multi-tenant routing without application code changes.

The regex header rewrite functionality allows pattern-based transformations using regular expressions. You can extract path segments, modify query parameters, and inject headers based on request characteristics. This capability reduces the need for application-level request transformation logic and centralizes routing concerns at the infrastructure layer.

alb_request_rewrite_pipeline
ALB request transformation pipeline with URL and header rewrite stages

The following table summarizes 2025 feature additions across both load balancer types:

FeatureNLB supportALB supportPrimary use case
Weighted target groupsYes (new)YesCanary deployments, traffic shifting
Target OptimizerNoYes (new)Automatic load distribution
URL rewritingNoYes (enhanced)Request transformation
Host header rewriteNoYes (enhanced)Multi-tenant routing
QUIC supportYesNoHTTP/3 workloads
Auto concurrency limitsNoYes (new)Overload protection

Feature capabilities influence architecture decisions, but cost implications often determine final load balancer selection in budget-conscious organizations.

Cost comparison and pricing models

Pricing structures differ fundamentally between NLB and ALB, reflecting their distinct resource consumption patterns. Both load balancers charge a base hourly rate of approximately $0.0225 (in most US regions), but their usage-based components are calculated differently to favor their respective traffic patterns.

ALB Pricing (LCU Model) ALB uses Load Balancer Capacity Units (LCUs), charged at $0.008 per LCU-hour. The LCU is calculated based on the highest value across four dimensions:

  1. New connections: Up to 25 per second.
  2. Active connections: Up to 3,000 per minute.
  3. Processed bytes: 1 GB per hour for EC2/containers.
  4. Rule evaluations: Up to 1,000 per second (after the first 10 free rules).

NLB Pricing (NLCU Model) NLB uses Network Load Balancer Capacity Units (NLCUs), which are roughly 25% cheaper than LCUs at $0.006 per NLCU-hour. The NLCU dimensions are optimized for high-volume network traffic:

  1. New flows: Up to 800 per second (TCP) or 400 per second (UDP).
  2. Active flows: Up to 100,000 (TCP) or 50,000 (UDP).
  3. Processed bytes: 1 GB per hour for all targets.
Cost FactorApplication Load Balancer (ALB)Network Load Balancer (NLB)
Capacity UnitLCU (Load Balancer Capacity Unit)NLCU (Network Load Balancer Capacity Unit)
Unit Price$0.008 per LCU-hour$0.006 per NLCU-hour
Rule EvaluationsCharged after 10 free rulesNot applicable (No L7 rules)
Best ForComplex routing, low-to-mid throughputHigh-throughput, persistent connections

Pro tip: For senior-level discussions, note that NLB is almost always more cost-effective for high-bandwidth, “fat” pipe applications because NLCUs are cheaper and can handle significantly more new and active connections per unit than ALBs. However, an ALB can be more economical if it allows you to consolidate dozens of microservices behind a single load balancer using path-based routing, rather than paying the base hourly fee for multiple NLBs.

Security features and TLS handling approaches

Security implementation differs significantly between NLB and ALB due to their architectural positioning. ALB performs TLS termination, decrypting incoming HTTPS traffic at the load balancer and forwarding unencrypted HTTP to targets. This approach enables ALB to inspect request content for routing decisions and offloads cryptographic processing from application servers.

NLB offers two TLS handling modes. TLS passthrough forwards encrypted traffic directly to targets without decryption, maintaining end-to-end encryption for compliance requirements that mandate encryption in transit throughout the entire path. TLS termination mode decrypts at NLB but cannot inspect Layer 7 content, limiting its utility compared to ALB termination.

tls_handling_comparison
TLS termination versus passthrough security architectures

Authentication and access control capabilities

ALB provides native authentication integration through Amazon Cognito and OIDC-compliant identity providers. The 2025 updates enhanced ALB JWT verification capabilities, allowing the load balancer to validate JSON Web Tokens before forwarding requests to targets. This feature offloads authentication logic from application code and provides centralized access control.

NLB lacks application-layer authentication features due to its Layer 4 positioning. Authentication must occur at the target level or through upstream components. However, NLB supports security groups (added in recent updates) and integrates with AWS PrivateLink for private connectivity patterns that never traverse the public internet.

Watch out: TLS termination at ALB means traffic between ALB and targets travels unencrypted unless you configure target-side HTTPS. For PCI-DSS or HIPAA compliance, verify your encryption requirements permit this architecture or implement re-encryption to targets.

Security requirements often dictate load balancer selection before other factors enter consideration. With security implications understood, constructing a decision framework helps systematically evaluate which load balancer fits specific use cases.

Decision guide for selecting between ALB and NLB

Selecting the appropriate load balancer requires evaluating multiple dimensions beyond simple protocol requirements. Senior engineers approach this decision by mapping technical requirements against business constraints, considering both immediate needs and future scalability. The following framework structures this evaluation process.

When to choose Network Load Balancer

NLB becomes the clear choice when your architecture exhibits specific characteristics that align with Layer 4 load balancing strengths. Evaluate NLB for the following scenarios:

  1. Ultra-low latency requirements where sub-millisecond overhead matters
  2. Non-HTTP protocols including custom TCP, UDP, or database connections
  3. QUIC or HTTP/3 traffic requiring UDP-based load balancing
  4. End-to-end TLS encryption requirements using passthrough mode
  5. Extremely high throughput workloads exceeding millions of requests per second
  6. Static IP address requirements for firewall allowlisting or DNS configuration

When to choose Application Load Balancer

ALB provides superior value when your architecture requires content-aware traffic distribution or HTTP-specific features. Consider ALB for these use cases:

  • Microservices routing: Path-based distribution across multiple services from a single endpoint
  • Multi-tenant applications: Host header routing for SaaS platforms serving multiple domains
  • Authentication offloading: Centralized JWT verification or Cognito integration
  • Canary deployments: Weighted routing with request-level granularity
  • WebSocket applications: Native protocol support with connection upgrade handling
  • gRPC services: HTTP/2-based RPC with proper streaming support

Real-world context: Many production architectures use both load balancer types. A common pattern places NLB in front of ALB to gain static IP addresses while preserving Layer 7 routing capabilities, though this adds cost and latency.

load_balancer_decision_tree
Decision tree for selecting between Network Load Balancer and Application Load Balancer

Conclusion

The network load balancer vs application load balancer decision fundamentally comes down to whether your architecture requires content-aware routing at Layer 7 or prioritizes raw performance at Layer 4. NLB delivers sub-millisecond latency and protocol flexibility for TCP, UDP, and QUIC workloads. ALB provides sophisticated HTTP routing, authentication integration, and the new Target Optimizer for intelligent traffic distribution. The 2025 AWS updates narrowed the capability gap with NLB weighted target groups and enhanced ALB request transformation, but the core architectural distinction remains unchanged.

Cost optimization requires matching your traffic patterns to each load balancer’s pricing model. NLB favors persistent connections, while ALB proves economical for complex routing consolidation. Security requirements often become the deciding factor, particularly for compliance frameworks mandating end-to-end encryption that only NLB passthrough can provide. As AWS continues expanding both services, architects should revisit this decision periodically as new features may shift the optimal choice for evolving workloads.

Master these trade-offs thoroughly. Cloud Engineer interviews increasingly probe candidates on load balancer selection rationale, expecting articulation of OSI layer implications, performance characteristics, and cost considerations that demonstrate genuine architectural thinking rather than surface-level feature comparison.