Choosing the Right Load Balancing for Microservices: Centralized, In‑Process, Independent
The article explains three primary load‑balancing and service‑discovery patterns for microservice architectures—centralized external load balancers, client‑side soft load balancing, and independent host‑level LB processes—detailing their mechanisms, advantages, drawbacks, and real‑world examples such as F5/HAProxy, Netflix Eureka/Ribbon, and Airbnb SmartStack.
Microservice architecture consists of many fine‑grained services that communicate via lightweight mechanisms, which introduces service registration and discovery, load balancing, and health‑check concerns.
01 Centralized Load Balancer
An independent load balancer (hardware like F5 or software such as LVS, HAProxy) holds a mapping of service addresses. Clients discover the LB via DNS. The LB performs load‑balancing (e.g., round‑robin) and health checks. Drawbacks include a single point of failure and added latency.
02 In‑Process Load Balancer (Soft Load Balancing)
This approach embeds the LB logic inside the client process, requiring a service registry (e.g., Zookeeper, Consul, Etcd) for self‑registration and discovery. The client queries the registry, caches the address list, applies a balancing strategy, and calls the target directly, avoiding extra hops. It demands a highly available registry and incurs development overhead for multiple language client libraries; upgrades also require code changes. Examples: Netflix Eureka with Karyon and Ribbon, Alibaba Dubbo.
03 Independent LB Process
A compromise that runs a separate LB process on each host. Services on the same host query this local LB for discovery and balancing, using a registry (e.g., Zookeeper) for health checks. It eliminates the single‑point failure of a centralized LB, avoids client‑side libraries, and simplifies upgrades, though deployment is more complex. Example: Airbnb SmartStack with Zookeeper, Nerve, and Synapse/HAProxy.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
