Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scaling out the zuul proxy

We have scaled out all sevices in our system by having more than one instance of them registered in eureka service registry.

Also, they are also proxied by a zuul server in the front.

My question is how can we ensure the scalability of zuul proxy when accessed from clients.

One solution i can think of is having multiple instances of the proxy registered in eureka registry. But if that is done how do we decide on which of the instances would be exposed to the clients.

like image 218
juser Avatar asked Mar 07 '16 02:03

juser


1 Answers

We faced the same issue in our application, having multiple instances of multiple types of micro-service-type applications on our backend. All servers registered with Eureka. The problem is that we also had multiple security gateways configured (based on the architecture described in this excellent tutorial: https://spring.io/guides/tutorials/spring-security-and-angular-js/).

Eventually we decided to use a hardware http load balancer that calls our security gateways in a round-robin approach (our solution is on-prem).

We use Redis with @EnableHttpRedisSession annotation to have the spring session synced across all the servers, so the http load balancer does not have to deal with sticky sessions or stateful considerations. It just does a round-robin to all the security gateways. It doesn't matter if the load balancer hits SG1, SG2 or SG3, they all share the same session information coming from Redis (which is also configured for fail-over with Redis Sentinel).

like image 69
odedia Avatar answered Jan 02 '23 21:01

odedia