0% completed
Understanding the basic architecture of the Service Discovery pattern is the first step. However, a deeper look into its inner mechanics is needed to grasp the actual implementation and nuances of this pattern. The following sections will delve into these details and provide a more refined picture of the Service Discovery pattern.
In terms of registration, there are two primary methodologies to consider: self-registration and third-party registration.
In the Self-Registration approach, services are responsible for registering and deregistering themselves with the Service Registry when they come online or go offline. The upside to this approach is the simplicity and the control it gives to the service. However, the downside is the added responsibility on the service to keep its status up-to-date.
On the other hand, Third-Party Registration leverages a service manager that handles the registration process. The service manager monitors the services and updates their status in the Service Registry accordingly. This approach takes the burden off the services but introduces another component in the system that needs to be managed.
Once a service is registered, how does the Service Registry know it's still available? This is where health checks come in. Health checks are a way of monitoring the status of services. They can take two primary forms:
Self-Reporting: In this approach, also known as the heartbeat model, services send a periodic signal to the Service Registry indicating they are still active. If the Service Registry doesn't receive a signal from a service within a given timeframe, it assumes the service is offline and removes it from its records.
Active Monitoring: Here, the Service Registry proactively checks the status of services by sending a ping or a similar request. If it doesn't receive a response, it marks the service as offline.
.....
.....
.....