The term Microservices refers to a software architectural style that builds single applications as suites of independently-deployable services that typically communicate via APIs. A well-known implementation of this is Netflix, whose wide-spread architecture receives more than a billion calls to its streaming-video API every day.
Each incoming API call then prompts around 5 additional calls to various backend services to perform dedicated tasks to satisfy the request. One issue with modern cloud-based microservice architectures, however, is the dynamic nature of the network location of a service instance. Dynamically-assigned network locations facilitate auto-scaling and upgrades, but require a comprehensive service discovery method, as discussed in this microservices discovery overview by Patrick Nommensen for DZone.
The article covers the different types of service discovery patterns, which can occur on either the client-side or the server-side, with responsibility for ongoing discovery lying with the named party. For example, server-side discovery requires the client to make a request to the service via the load balancer, such as AWS Elastic Load Balancer (ELB), using its DNS name. When the ELB receives a request, it balances the traffic among its registered EC2 instances and ECS containers.
The client-side discovery pattern uses a service registry that provides a REST API for service instance registration and querying. Netflix’s service registry Eureka works in tandem with the IPC client Netflix Ribbon for balancing the load across available instances.
The article also discusses self- and third-party-registration patterns, with examples of implementations and relevant tools mentioned throughout. This is the fourth article in a series of seven around building applications with microservices.