WebFlux vs. Blocking (MVC): User Experience

Evaluate the difference in user experience between the reactive approach (Spring WebFlux) and the blocking approach (Spring MVC).

We'll cover the following

Comparing user experience

Let’s start our comparison with the most noticeable difference for web users: user experience. We’ll use the frontend for this comparison.

Playing the user’s role is quite simple in this application: enter values for the given parameters (pagination, page number, and size) and press either the “Reactive Request” or the “Blocking Request” button. That will put our implementation into practice, calling the backend services from the web page and processing the response either as small portions (WebFlux) or as a whole thing (Web MVC). This is covered by the previous chapters, so we won’t dive into details of how this works.

You’ll quickly find out that, for the non-paginated requests and big page sizes, the user’s experience for the reactive case is much better. You don’t need to wait for the request to finish to start reading the quotes.

Keep in mind that this is a simulated scenario in which we’re forcing a constant delay per element from the server. In a real situation, where the server’s response time and the network latency may vary unpredictably, the benefit would be even more noticeable.

Get hands-on with 1200+ tech skills courses.