Reputation: 15435
I have a Microservice that is realised as a Play framework based HTTP service. We now want to add fault tolerance to this service by having another instance that picks up the requests when one instance goes down. Now I understand that Microservices are not designed from the ground up to be clustered as they are purely stateless, self sustaining components that are meant to simply run.
Are there ways wherein I could add failover support? I'm thinking of some external component that checks for the status of the service and reacts upon failures by starting another instance on some other host. Any suggestions?
Upvotes: 2
Views: 12928
Reputation: 2503
Generally, there is a discovery service
where the services can register theirselves. If a service needs to communicate with another service, it requests instances of these service at the discovery service and most of the time there is client-side load balancing as well.
I've also used Hystrix
to wrap HTTP calls to handle failure.
I'm not familiar with building microservices with the Play framework
, but when using Spring
I've used:
A blog series that provides an example using the full stack is this one. However, it is using Spring
but I guess it can be helpful either way.
Upvotes: 1