πŸ”₯ Launch Offer: Interview Preparation Bundle @ β‚Ή2,499 β‚Ή9,999 β€’ 75% OFF. Offer expires in πŸ”₯ Launch Offer: Interview Preparation Bundle @ β‚Ή2,499 β‚Ή9,999 β€’ 75% OFF. Offer expires in Interview Preparation Bundle @ β‚Ή2,499 β‚Ή9,999

00:00:00 Get Bundle
home deployment external-load-balancing-and-internal-service-to-service-load-balancing
Interview guide Deployment 8 sections

External load balancing and Internal service-to-service load balancing

This is one of the biggest concepts to understand in modern microservices. Let's separate them clearly. 1. External Load Balancing (Client β†’ Cluster) This load balancer receives requests…

Start reading
By javainterviewprep June 11, 2026 2 min read

This is one of the biggest concepts to understand in modern microservices. Let’s separate them clearly.


1. External Load Balancing (Client β†’ Cluster)

This load balancer receives requests coming from outside your system (browser, mobile app, third-party APIs).

Example:

             Internet
β”‚
β”‚
External Load Balancer
(AWS ALB / Nginx / Ingress)
β”‚
β”‚
API Gateway Service
β”‚
-------------------
Kubernetes Cluster

The job is to distribute traffic coming from users.

Example:

User 1 ────────┐
User 2 ─────────
User 3 ─────────
β–Ό
External Load Balancer
β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β–Ό β–Ό
Gateway Pod 1 Gateway Pod 2

If Gateway Pod 1 dies,

External LB
β”‚
β–Ό
Gateway Pod 2

Users never notice.


Who provides this?

Usually

  • AWS ALB
  • AWS NLB
  • Azure Load Balancer
  • Google Cloud Load Balancer
  • Nginx Ingress
  • HAProxy

2. Internal Service-to-Service Load Balancing

Now suppose API Gateway wants to call Payment Service.

Payment service has 4 replicas.

Payment Pod 1
Payment Pod 2
Payment Pod 3
Payment Pod 4

Gateway shouldn’t always hit Pod 1.

Instead,

Gateway
β”‚
β–Ό
Payment Service
β”‚
β”Œβ”€β”€β”Όβ”€β”€β”¬β”€β”€β”
β–Ό β–Ό β–Ό β–Ό
P1 P2 P3 P4

Kubernetes Service distributes traffic among all pods.

This is internal load balancing.

No internet involved.


Complete Flow

Browser
β”‚
β–Ό
External Load Balancer
β”‚
β–Ό
API Gateway
β”‚
β–Ό
Accounts Service
β”‚
β–Ό
Payment Service
β”‚
β–Ό
Database

Notice

Only the first request comes through the external load balancer.

Everything inside the cluster uses Kubernetes Services.


Example

Suppose Payment has three pods.

payment-service

β”‚
β–Ό
-----------------------
| Pod1 |
| Pod2 |
| Pod3 |
-----------------------

Accounts Service sends requests.

Request 1

Accounts
β”‚
β–Ό
payment-service
β”‚
β–Ό
Pod1

Request 2

Accounts
β”‚
β–Ό
payment-service
β”‚
β–Ό
Pod3

Request 3

Accounts
β”‚
β–Ό
payment-service
β”‚
β–Ό
Pod2

Accounts Service never knows which pod handled the request.

It only calls

http://payment-service

Before Kubernetes (Spring Cloud Netflix Era)

In older microservices architecture, we often used:

Accounts
β”‚
β–Ό
Spring Cloud LoadBalancer
β”‚
β–Ό
Eureka Server
β”‚
β–Ό
Payment Instance List

Flow:

  1. Payment instances register with Eureka.
  2. Accounts asks Eureka for available instances.
  3. Spring Cloud LoadBalancer chooses one instance.
  4. Request is sent directly.
Accounts
β”‚
β–Ό
Spring Cloud LoadBalancer
β”‚
β–Ό
10.0.0.11
10.0.0.12
10.0.0.13

With Kubernetes

No Eureka is required.

Accounts
β”‚
β–Ό
payment-service
β”‚
β–Ό
Kubernetes Service
β”‚
β”Œβ”€β”€β”Όβ”€β”€β”¬β”€β”€β”
β–Ό β–Ό β–Ό β–Ό
P1 P2 P3 P4

Kubernetes itself:

  • Discovers pods
  • Removes unhealthy pods
  • Adds new pods automatically
  • Balances requests

Modern Enterprise Architecture

                    Internet
β”‚
β–Ό
External Load Balancer
(AWS ALB / Nginx Ingress)
β”‚
β–Ό
API Gateway
β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β–Ό β–Ό β–Ό
Accounts Orders Customer
β”‚ β”‚
β”‚ β–Ό
β”‚ payment-service
β”‚ β”‚
β”‚ Kubernetes Service
β”‚ β”‚
β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
β–Ό β–Ό β–Ό
Payment1 Payment2 Payment3
  • External load balancing: Handles traffic from clients into your cluster (e.g., to the API Gateway).
  • Internal service-to-service load balancing: Happens inside the cluster. Services communicate using Kubernetes Service names (like http://payment-service), and Kubernetes automatically distributes requests across healthy pod replicas.

This separation is one of the key differences between traditional microservice deployments and Kubernetes-native architectures.