Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Cloud Gateway or Zuul2, Which one is the right replacement for Zuul1?

Since Spring Cloud team has abandoned development of Zuul module, we are moving to Spring Cloud Gateway or Zuul2 but I believe Zuul2 needs a lot of changes in the architecture and needs big changes in the microservices(correct me if i'm wrong), can anyone gives a recommendation on zuul2 or Spring-Cloud-Gateway, has anyone or you know any big player in tech using Spring-Cloud-Gateway?

like image 723
Kyle Avatar asked Jun 10 '19 15:06

Kyle


People also ask

Which is better Zuul or spring Cloud gateway?

Zuul is built on servlet 2.5 (works with 3. x), using blocking APIs. It doesn't support any long lived connections, like websockets. Gateway is built on Spring Framework 5, Project Reactor and Spring Boot 2 using non-blocking APIs.

Which API gateway is best for spring boot microservices?

Spring Cloud Gateway provides a library for building an API Gateway on top of Spring WebFlux. Spring Cloud Gateway aims to provide a simple, yet effective way to route to APIs and provide cross-cutting concerns to them such as security, monitoring/metrics, and resiliency.

What is the replacement of Zuul?

HAProxy (High Availability Proxy) is a free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. ...

Is Spring Cloud gateway an API gateway?

Spring Cloud Gateway provides a library for building API gateways on top of Spring and Java. It provides a flexible way of routing requests based on a number of criteria, as well as focuses on cross-cutting concerns such as security, resiliency, and monitoring.


2 Answers

Zuul1 is blocking whereas Zuul2 and spring cloud gateway are non-blocking and this is a major performance factor for a gateway, as a non-blocking model requires less resources to serve the same amount of requests as compared to a blocking gateway.

Now, coming to spring cloud gateway and Zuul2 - Spring Cloud does not provide any out of the box integration with Zuul2. Gateway has many features that are not available in the public version of Zuul2 such as Rate limiting, etc. Also, with the gateway you can have custom filters defined per route and there are tons of built-in filters defined as well, which helps a lot to get started.

Actually, there are many things which are not possible to explain here. You can follow the gateway documentation here - https://cloud.spring.io/spring-cloud-static/spring-cloud-gateway/2.0.2.RELEASE/single/spring-cloud-gateway.html

like image 178
Dhiraj Ray Avatar answered Sep 30 '22 01:09

Dhiraj Ray


I think SCG is the way to go due to the agreements between Netflix and Pivotal, with the former leaning more toward the spring boot/cloud ecosystem as stated in https://medium.com/netflix-techblog/netflix-oss-and-spring-boot-coming-full-circle-4855947713a0

Performance-wise it also seems like a good bet: https://www.bytesville.com/zuul-spring-cloud-gateway-comparison-benchmarks-loadtesting/

like image 26
David G. Avatar answered Sep 29 '22 23:09

David G.