110

I have been using Zuul as the edge service and API Gateway. Recently I have noticed that Spring Cloud Platform release Spring Cloud Gateway. What is the difference between the two gateways? Why is the Zuul not extended to support the functionalities in S-C-Gateway? What was the driving factor for a new library altogether? When should it be used?

Vik David
  • 3,640
  • 4
  • 21
  • 29
zeagord
  • 2,257
  • 3
  • 17
  • 24

2 Answers2

228

I am the author of 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. Websockets are supported and it's a much better developer experience since it's tightly integrated with Spring.

spencergibb
  • 24,471
  • 6
  • 69
  • 75
  • 35
    On Sept/Oct 2016, Netflix released Zuul 2. It is a non-blocking and asynchronous solution. The major architectural difference between Zuul 2 and Zuul 1 is that Zuul 2 is running on an asynchronous and non-blocking framework, using Netty. – alltej Dec 22 '17 at 22:04
  • 5
    They have not released zuul 2, they announced it. The current development is being done on the 2.1 branch. – spencergibb Dec 22 '17 at 22:06
  • 5
    @spencergibb Is the performance problems of spring-cloud-gateway mentioned in [this](https://engineering.opsgenie.com/comparing-api-gateway-performances-nginx-vs-zuul-vs-spring-cloud-gateway-vs-linkerd-b2cc59c65369) comparison solved? 229ms (scg) compared to 29ms (Zuul1) on 8core-16gb machine is not really useful. – Ruslan Stelmachenko Feb 19 '18 at 05:48
  • 22
    Zuul 2.1.1 has been released on April 13, 2018. It is asynchronous and non-blocking. – bedrin Apr 19 '18 at 14:04
  • 8
    Is there any difference in performance between Cloud Gateway vs. Netflix Zuul 2? – Kevin Jul 19 '19 at 03:10
  • 4
    So now that Zuul 2 is also asynchronous, is it useful for web sockets over stomp or still Spring Cloud Gateway is recommended @spencergibb ? – Basav Sep 16 '19 at 19:04
  • 1
    Spring Cloud will not integrate zuul 2 – spencergibb Mar 13 '20 at 13:16
  • very well explained. Thanks – Az.MaYo Jun 11 '21 at 10:13
  • For me, the websocket support is a huge thing, much needed if you are building an app which needs to show real time responses. – Manoj Majumdar Dec 03 '21 at 07:19
-1

--- This notes for spring 5 ---

Spring cloud gateway is replacement of zuul for the following reasons and advantages,

  • Spring Cloud Gateway is the preferred API Gateway implementation from the Spring Cloud team. It's built on Spring 5, Reactor, and Spring Web Flux. Not only that, but it also includes circuit breaker and Eureka service discovery.
  • Spring Cloud Gateway is non-blocking in nature. Through later Zuul 2 also support it, but still Spring Cloud Gateway has an edge here.
  • Spring Cloud Gateway has a superior performance compared to that of Zull.
Montaser Mahadi
  • 119
  • 1
  • 9