Full Reactive Stack
Learn how to build a full-reactive system from the database to the front-end, using a Reactive programming strategy leveraged by Spring WebFlux, with the simplicity offered by Spring Boot 2.
This mini-book is based on the popular Full Reactive Stack blog series, adapted and expanded for a complete learning experience.
📖 53 pages • 💻 Full code examples • 🎓 Interactive course available • 🎯 Practical approach
Master Full Reactive Stack Development
This book covers the complete reactive stack, from database to frontend, with practical examples and performance comparisons.
Reactive Programming
Master Project Reactor and Spring WebFlux for building non-blocking, reactive applications.
MongoDB Reactive
Implement full-reactive data persistence with MongoDB reactive driver and Spring Data.
Angular Frontend
Build reactive frontends with RxJS and EventSource for real-time data streaming.
Performance Analysis
Compare WebFlux vs MVC with benchmarks and understand when to use each approach.
Docker Deployment
Deploy the complete reactive stack using Docker and docker-compose.
Complete Source Code
All code examples available on GitHub with step-by-step implementation.
Spring WebFlux and MongoDB Reactive
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'll use MongoDB since it provides a reactive driver integrated with Spring Data.
The book includes both reactive and blocking implementations, allowing you to understand the differences and trade-offs between the two approaches.
- Non-blocking reactive endpoints
- Server-Sent Events support
- Backpressure handling
- MongoDB reactive driver
Angular with RxJS and EventSource
The book shows how to build a simple Angular application that uses RxJS and EventSource to connect to the reactive flow provided by the backend.
You'll learn how to consume Server-Sent Events, handle reactive streams in the frontend, and create a truly reactive user experience.
- RxJS Observables
- EventSource API
- Real-time data streaming
- Reactive UI updates
Complete Table of Contents
The Reactive Web
Introduction to reactive programming patterns and WebFlux fundamentals.
- Reactive Web Patterns
- WebFlux and Project Reactor
- Reactive Web: Advantages
- Is Non-Blocking the same as Reactive?
- The application overview
Full Reactive Stack Backend
Building the reactive backend with Spring Boot, WebFlux, and MongoDB.
- Project Reactor – Main Features
- WebFlux – Main Features
- Creating the application
- Repository Layer
- The Reactive Controller
- The Blocking Controller and Repository
- Loading data into MongoDB with an ApplicationRunner
- Running the backend
- Playing with Reactive and Classic endpoints
Connecting Angular with the WebFlux Backend
Creating a reactive frontend that connects to the WebFlux backend.
- Goal
- Why Angular?
- Creating the Angular application
- UI Application Overview
- The Angular Reactive service
- The Angular Components – Quick Overview
- Running the frontend
Conclusions
Performance analysis and comparison between WebFlux and traditional MVC.
- WebFlux vs. Blocking (MVC): user experience
- WebFlux vs. Blocking (MVC): performance
- WebFlux vs. Blocking (MVC): ease of development
- Suitability
- Testing
- Conclusions
Appendix: Running the application in Docker
Complete guide to containerizing and deploying the reactive stack.
- Generate the build artifacts
- Build and run the Spring Boot app in Docker
- Build the Angular app and run it in Docker
- Putting everything together with Docker Compose
Get Your Copy
Available as an e-book on Leanpub with pay-what-you-want pricing, or as an interactive course on Educative.io with hands-on coding exercises.