Show List
Introduction to Service Discovery
Service discovery refers to how the applications and microservices locate each other. In the cloud environment there can be multiple instances of microservices which will have different IP address and ports. The IP addresses for the instances may change overtime as the instances may go down and other may get created.
All applications and services communicating with a microservice need to be aware of all the instances. Service discovery helps by maintaining the information about all the instances of the service and providing the info to the service consumers.
- Service discovery provides mechanism for the microservices to register
- When the client asks, service discovery provides the way to find the registered service
Here is an example scenario of an online shopping website. There are microservices to handle orders and to process payment. Order service needs to send the information to payment service. But each instance or order service can not store the information (IP address and port) of each payment microservice so we use service discovery in the middle. The payment service registers itself with the service discovery so service discovery has information about IP address and port of each instance.
Leave a Comment