Skip to main content

Service Registry and Discovery

Learn Service Registry and Discovery (Microservices Fundamentals, Microservices) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Why You Can't Just Hardcode a URL In a microservices system running on containers/cloud infrastructure, service instances come and go - they scale up/down, restart, and get new IP addresses constantly. Hardcoding http://192.168.1.5:8081 for the Order Service simply breaks the moment that instance restarts elsewhere. The Fix: Service Registry and Discovery • A service registry is a directory where every service instance registers itself on startup ("I am Order Service, running at this address") and deregisters on shutdown. • Service discovery is how a caller finds a live instance of the service...

More lessons in Microservices Fundamentals