DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Why Your MCP Server Loses Session State Behind a Load Balancer
  • Understand the Sidecar Pattern by Deploying n8n to AWS Fargate
  • Solving Session Persistence for Model Context Protocol Servers at Enterprise Scale
  • Why Distributed Databases Fail at Coordination Boundaries

Trending

  • AI Coding Agent Guardrails: Finding Gaps in Tool Permissions
  • When One Docker Swarm Replica Became Unreachable Over an Overlay Network: A Production Case With Traefik
  • Event-Driven AI Systems With Kafka and Autonomous Agents
  • Claude Code Superpowers: The 5-Tool Stack That Ends Limits and Context Amnesia

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Software Design and Architecture
  3. Performance
  4. Content-based Load Balancer

Content-based Load Balancer

Here is a short guide to content-based load balancing, focusing on layers 4 and 7.

By 
Ram Chauhan
·
Aug. 26, 16 · Opinion
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
3.9K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

Load balancing can be performed at various layers in the Open Systems Interconnection (OSI) Reference Model for networking. Generally, load balancers run at Layer 4 (Transport) or at Layer 7 (Application).

So far different providers used to provide the load balancers only at Layer 4, but recently providers like AWS, Google Cloud, and NGINX, have come up with Layer 7, content-based load balancers also known as Application Load Balancer.

The Difference Between Layer 4 and Layer 7

Layer 4

It operates at transport layer with protocols like TCP/UDP and does not look inside of the actual network packets, remaining unaware of the specifics of HTTP and HTTPS. That means simply delivering the messages with no regard to content of the message, with a load balancing algorithm such as round-robin and by calculating the best destination server based on least connections or server response times.

Layer 7

It operates at a high-level of OSI model, i.e. application layer which deals with the content of the message. With a protocol such as HTTP, a load balancer can uniquely identify client sessions based on cookies and use this information to deliver all client's requests to the same server. 

New – AWS Application Load Balancer | AWS Blog

It is designed to handle streaming, real-time, and WebSocket workloads in an optimized fashion. Instead of buffering requests and responses, it handles them in streaming fashion. This reduces latency and increases the perceived performance of your application.

Benefits

  • URL based routing: Create a load balancer that routes to the different instances based on URL path.
  • Support for container-based applications: Container-based applications which are based on micro service architecture, the Content Based Load Balancer understands and supports its needs. It allows one instance to host several containers that listen on multiple ports behind the same target group and also performs fine-grained, port-level health checks.
  • Support for additional protocols: It supports two additional protocols like WebSocket and HTTP/2.
  • Cost Efficient: It is cheaper as compared to traditional load balancers. AWS charges 10% lower than 'Classic Load Balancers'.

Conclusion

Content Based Load Balancer is a way forward — a new alternative to traditional transport layer load balancers as it operates in a more efficient way.

Load balancing (computing)

Opinions expressed by DZone contributors are their own.

Related

  • Why Your MCP Server Loses Session State Behind a Load Balancer
  • Understand the Sidecar Pattern by Deploying n8n to AWS Fargate
  • Solving Session Persistence for Model Context Protocol Servers at Enterprise Scale
  • Why Distributed Databases Fail at Coordination Boundaries

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook