Why load balancer matters in application development

RMAG news

1. What are the number behind the layer … ?

Layers here directly indicate the network layers. We all know in computer science, the network operates at each hop on 2 common kinds layer of packets, OSI and regular 4 layers model.

2. Why network layers related to load balancers?

Each kind of balancer will take advantage of information and operate on a one specific layer.

2.1. Layer-4 load balancer

Layer 4 load balancer operates at the transport level, which means it can use transport information such as application ports and protocols without using application content (like media type, localization rules, or other criteria) to manages traffic.

This operation comes with the advantages that the load balancer doesn’t need to decrypt and inspect application messages, allowing them to be forwarded quickly, efficiently, and securely.

2.2. Layer 7 load balancer

Layer 7 load balancing operates at the application level, using protocols such as HTTP and SMTP to make decisions based on the actual content of each message.

When the network traffic comes, a layer 7 load balancer will terminates it, decrypt, inspect, make content-based routing decisions and initiates a new TCP connection to the appropriate upstream server, and writes the request to the server.

As you can see, this strategy definitely incurs a performance penalty, but allows more intelligent load balancing decisions and content optimizations.

Some use cases could be:

Using cookie information for load-balancing decision: such as provide server persistence through session-based connection. Sending multiple requests to a server could help increase performance as we don’t have to establish connection for every request to the server.

Content caching at load balancer can be used: For example, the load balancer performs an calculation for load-balancing decision based on different kinds of content metrics, it then can store and use the result to achieve a more efficient decisions for the next similar requests.

Leave a Reply

Your email address will not be published. Required fields are marked *