API Design – Load Balancer or API Gateway Availability

api-designfailureload balancingmicroservices

I'm developing a microservice system. I have a discovery service (Eureka) for all my services and an API Gateway (Zuul) to call each service via an URL.

My problem: How can I assure that a service call via my API Gateway is high available?

If the gateway dies, my services aren't callable anymore. I could start multiple gateways but then the client needs to know which gateway to call. Wll than I need a load balancer between the client and my gateway. But what happens if the load balancer dies?

I could set up a second system and route a DNS entry to both systems but still, a broken load balancer could break one complete system?

So, is there a good solution to make load balancers or a api gateway high available? Or will there ever be a single point of failure per system?

Best Answer

I would have thought this would have an answer by now as its a standard problem.

I'm going to have to give a fairly generic answer im afriad as its not my specialty.

Basically you have two load balancers, a master and a slave and a way to switch between them if one fails. Usually a shared ip address which is either active or not.

Now you have both boxes talk to each other so they can detect when one fails.

If the master fails, say its unplugged, the slave detects the lost connection and activates, becoming master. Usually by grabbing the network traffic for the shared IP address.

You can have whole sets of machines in such a cluster, as long as they all talk amongst themselves and decide who is the master you are good.

Related Topic