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.

Now I'm working at a Dutch company as Solutions Architect for a project based on microservices. I like keeping ways of working as practical as possible but, at the same time, producing proper documentation and sharing knowledge.

I'm the author of the blog about software development The Practical Developer: 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

Authors have earned$8,948,210writing, publishing and selling on Leanpub,
earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

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

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses! 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