Microservice Patterns | Design Patterns | Service Load Balancing


Microservice and Containerization Patterns > Scalability Patterns > Service Load Balancing
Home > Design Patterns > Service Load Balancing

Service Load Balancing (Erl, Naserpour)

How can a deployed microservice accommodate increasing workloads?

Service Load Balancing

Problem

A single microservice implementation has a finite capacity, which can lead to runtime exceptions, failure and performance degradation when its processing thresholds are exceeded.

Solution

Redundant deployments of the microservice are created and a load balancing system is added to dynamically distribute workloads across microservice implementations.

Application

The duplicate microservice implementations are organized into a resource pool. The load balancer is positioned as an external component or may be built-in, allowing hosting servers to balance workloads among themselves.

Redundant implementations of the microservice are deployed, each located on a different virtual or physical server. A load balancer is utilized to intercept service consumer requests in order to evenly distribute them across the multiple microservice implementations.

Service Load Balancing: The load balancing agent intercepts messages sent by service consumers (1) and forwards the messages at runtime to the virtual servers so that the workload processing is horizontally scaled (2). Each virtual server receives requests based on its capacity, meaning none will be over-utilized. 

The load balancing agent intercepts messages sent by service consumers (1) and forwards the messages at runtime to the virtual servers so that the workload processing is horizontally scaled (2). Each virtual server receives requests based on its capacity, meaning none will be over-utilized.

Depending on the anticipated workload and the processing capacity of hosting server environments, multiple microservice implementations may be established in order to create pools of microservices, as explained in the complete pattern description.

Module 10: Advanced Microservice Architecture & Containerization.

This pattern is covered in Module 10: Advanced Microservice Architecture & Containerization..

For more information regarding microservice and containerization courses and accreditation,
visit the Microservice Architect Certification program page..