Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Spring WebFlux is a web framework that’s built on top of Project Reactor, to give you asynchronous I/O, and allow your application to perform better. 

Reactive web programming is great for applications that have streaming data, and clients that consume it and stream it to their users. It ain’t great for developing CRUD apps. If you want to develop a CRUD API, stick with Spring MVC.

Sounrce: https://developer.okta.com/blog/2018/09/24/reactive-apis-with-spring-webflux

The original web framework included in the Spring Framework, Spring Web MVC, was purpose-built for the Servlet API and Servlet containers. The reactive-stack web framework, Spring WebFlux, was added later in version 5.0. It is fully non-blocking, supports Reactive Streams back pressure, and runs on such servers as Netty, Undertow, and Servlet 3.1+ containers.

https://docs.spring.io/spring-framework/docs/current/reference/html/web-reactive.html

Webflux supports:

  • Annotation-based reactive components
  • Functional routing and handling

Pros & cons

The original web framework included in the Spring Framework, Spring Web MVC, was purpose-built for the Servlet API and Servlet containers. The reactive-stack web framework, Spring WebFlux, was added later in version 5.0. It is fully non-blocking, supports Reactive Streams back pressure, and runs on such servers as Netty, Undertow, and Servlet 3.1+ containers.

Source: https://docs.spring.io/spring-framework/docs/current/reference/html/web-reactive.html


Webflux supports:

  • Annotation-based reactive components
  • Functional routing and handling

Pros & cons

ProsCons
  • Better scalability due to non blocking threads
  • Use less threads (1 per core)
  • Better CPU Efficiency
ProsCons
  • Better scalability due to non blocking threads
  • Use less threads (1 per core)
  • Better COU Efficiency
  • b


Links to materials

https://www.baeldung.com/spring-webflux

...