When to choose what?

Reactive programming is quite good but that doesn't mean that we have to go reactive for every application. Along the same lines, not all the applications are a good fit for Spring WebFlux. Choose the framework by looking at the requirements and how these frameworks can solve them. If an application is working fine with Spring MVC as a framework, there is no need to port that to Spring WebFlux. In fact, as mentioned earlier, good parts of reactive can be brought into Spring MVC if needs be without much trouble.

Also, if the application already has blocking dependencies (JDBC, LDAP, and so on), then it's better to stick with Spring MVC as there would be complications bringing in reactive concepts. Even if we bring in reactive concepts, many parts of the application are in blocking mode, which will prevent taking full advantage of such a programming paradigm.

Adopt Spring WebFlux if your application deals with streams of data (input and output). Also, consider this as the web application choice if scalability and performance is of utmost importance. By their sheer nature, asynchronous and non-blocking, these applications would be performant compared to synchronous and blocking. Being asynchronous, they can deal with latencies and are more scalable.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.185.69