Full Reactive Stack with Spring Boot, WebFlux and MongoDB
Full Reactive Stack with Spring Boot, WebFlux and MongoDB
Minimum price
Suggested price
Full Reactive Stack with Spring Boot, WebFlux and MongoDB

This book is 100% complete

Completed on 2018-07-15

About the Book


You will learn how to develop Reactive Web endpoints using Spring Reactor and Spring WebFlux, the alternative to MVC. To make it full-reactive, you will use MongoDB since it provides a reactive driver integrated in Spring Data.


This book shows how to build a simple Angular application (since the book focuses more on the backend) that uses RxJS and EventSource to connect to the reactive flow provided by the backend (supported by WebSockets).


To make easier the build and deploy of the application, the source code includes docker-compose files that you can use to run the complete reactive stack.

Benchmark and WebFlux vs. MVC analysis

The last chapter is focused on comparing MVC with WebFlux in a practical way, and analysing what are the pros/cons depending on your use case.

Source Code

All the source code related to this book is available on GitHub.

Note: This mini-book is is based on the posts Full Reactive Stack Guide, but their format has been adapted so it's easier to read as a complete guide.

About the Author

Moisés Macero
Moisés Macero

I'm developing software since I was a kid, when my parents bought me a Spectrum ZX (in which I also played great videogames...). I've worked at startups, where a developer is a real full-stack developer (from frontend to backend, from building to maintaining, from the cave to customer-facing meetings) and also at big companies, where stability and keeping high product quality standards is a must. Along my career I have been involved usually in development, design and architecture, for small and huge projects. Worked in waterfall and agile environments.

I'm now working at a Dutch company as Solutions Architect for a very ambitious project based on microservices with Spring Boot. I like writing documentation to help others to learn how to develop better software.

I'm also the author of the blog about software development ThePracticalDeveloper: https://thepracticaldeveloper.com and the book Learn Microservices with Spring Boot.

Table of Contents

  1. The Reactive Web approach
  2. About this guide
  3. Goals
  4. Reactive Web Overview
  5. Reactive Web Patterns
  6. WebFlux and Project Reactor
  7. Blocking vs. Non-Blocking: Advantages
  8. Is Non-Blocking the same as Reactive?
  9. The application
  10. Full Reactive Stack Backend
  11. In this chapter
  12. Project Reactor – Main Features
  13. Overview
  14. Fluxes and Monos
  15. Reactor Integrations
  16. WebFlux – Main Features
  17. Standard Controllers and Router Functions
  18. WebClient
  19. Creating the application
  20. Spring Boot Reactive Skeleton
  21. Planning our way
  22. Repository Layer
  23. Reactive Repository with Spring 5 and Spring Data
  24. Saving entities in a reactive manner
  25. The Quote class
  26. The Reactive Controller
  27. Controller Code
  28. Simulating poor performance
  29. Pagination
  30. Enabling CORS in Spring WebFlux
  31. Returning a Flux from a Controller: behind the scenes
  32. The blocking Controller and Repository
  33. Loading data into MongoDB with a CommandLineRunner
  34. Running the backend
  35. Running MongoDB with Docker
  36. Running the Spring Boot Reactive application
  37. Playing with Reactive and Classic endpoints
  38. Connecting Angular with the WebFlux Backend
  39. Goal
  40. Why Angular?
  41. Creating the Angular application
  42. Application Overview
  43. The Angular Reactive service
  44. The Angular Components – Quick Overview
  45. Running the frontend
  46. Running the WebFlux – Angular application with Docker
  47. Preparing our apps to be dockerized
  48. Performance Analysis
  49. WebFlux vs. Blocking (MVC): user experience
  50. WebFlux vs. Blocking (MVC): performance
  51. Benchmark details
  52. Server Side: Requests Served per Second
  53. Client Side: Average Time per Request
  54. WebFlux vs. Blocking (MVC): ease of development
  55. Suitability
  56. Testing
  57. Conclusions

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Write and Publish on Leanpub

Authors, publishers and universities use Leanpub to publish amazing in-progress and completed books and courses, just like this one. You can use Leanpub to write, publish and sell your book or course as well! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub