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.
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.
- The Reactive Web approach
- About this guide
- Reactive Web Overview
- Reactive Web Patterns
- WebFlux and Project Reactor
- Blocking vs. Non-Blocking: Advantages
- Is Non-Blocking the same as Reactive?
- The application
- Full Reactive Stack Backend
- In this chapter
- Project Reactor – Main Features
- Fluxes and Monos
- Reactor Integrations
- WebFlux – Main Features
- Standard Controllers and Router Functions
- Creating the application
- Spring Boot Reactive Skeleton
- Planning our way
- Repository Layer
- Reactive Repository with Spring 5 and Spring Data
- Saving entities in a reactive manner
- The Quote class
- The Reactive Controller
- Controller Code
- Simulating poor performance
- Enabling CORS in Spring WebFlux
- Returning a Flux from a Controller: behind the scenes
- The blocking Controller and Repository
- Loading data into MongoDB with a CommandLineRunner
- Running the backend
- Running MongoDB with Docker
- Running the Spring Boot Reactive application
- Playing with Reactive and Classic endpoints
- Connecting Angular with the WebFlux Backend
- Why Angular?
- Creating the Angular application
- Application Overview
- The Angular Reactive service
- The Angular Components – Quick Overview
- Running the frontend
- Running the WebFlux – Angular application with Docker
- Preparing our apps to be dockerized
- Performance Analysis
- WebFlux vs. Blocking (MVC): user experience
- WebFlux vs. Blocking (MVC): performance
- Benchmark details
- Server Side: Requests Served per Second
- Client Side: Average Time per Request
- WebFlux vs. Blocking (MVC): ease of development
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. Free App. 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), MOBI (for Kindle) and in the free Leanpub App (for Mac, Windows, iOS and Android). 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.