5

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?

Milgo
  • 161

2 Answers2

5

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.

Ewan
  • 83,178
2

Rather than reinvent the wheel I would explore software as well as potentially PaaS offerings in various cloud providers that solve all the sticky problems of HA and dealing with single points of failure.

There are hardware load balancers (eg. F5 Big IP), software load balancers (eg. ngnix, HAProxy, Kubernetes, etc...) and cloud load balancers (AWS Elastic Load Balancer) and all of these have redundancy and various failover schemes to prevent single point of failure.

In terms of DNS records, there are various strategies that employ this as well to ensure that redundancy and failover can be handled smoothly. Scripting the update of DNS records, adjusting TTL on DNS entries, utilizing a CDN like Akamai for automatic DNS resolution and geolocated endpoints. Many cloud providers have platform features that you can leverage here as well.

The possibilities are legion and one can write many books on the subject as a whole, so it is important to do your research and find out what makes sense for your application architecture.

maple_shaft
  • 26,570