Video in progress

What's the difference between client-side discovery and server-side discovery?

In client-side, the caller gets the list of instances from the registry and does the load balancing itself (Eureka + Spring Cloud LoadBalancer). In server-side, the caller talks to a single address, and a load balancer or the platform picks the instance (a Kubernetes Service, AWS ALB).

📖 Answer

Client-side:

order-service --(asks for the list)--> Eureka
order-service --(picks one itself)---> payment #2

In Spring, lb://payment-service or a @LoadBalanced RestClient.Builder does this. The benefit: no extra hop, and you control the balancing strategy yourself. The drawback: every language and every service needs this library.

Server-side:

order-service --> http://payment-service (K8s Service / LB) --> payment #2

The caller knows nothing and just sends a plain HTTP request. The language doesn't matter. But there's one more component on the path, and it has to be reliable too.

In practice, most projects today run on Kubernetes, and the server-side option is enough. Eureka is mostly found in older infrastructure or setups without Kubernetes.