
Foreword
Spring Framework is the most popular Java library. Its community keeps growing, and its appeal is being renewed in particular with Spring Boot.
In fact, we are lucky to count you in this open-source adventure as you read these lines!
A key to the Spring portfolio's success? It endures the challenge of time, and its ecosystem evolves and anticipates software industry changes with a carefully crafted domain.
So, why are Spring projects going Reactive now and what's Reactive anyway?
Without spoiling the friendly introduction Greg has prepared for you, let's focus on the "non-blocking" nature of Reactive Programming. Imagine yourself brewing beer. It does take a certain time to ferment the precious liquid before bottling it up. Would you stay for two weeks watching your preparation fermenting and do nothing else, such as answering a call or watching the last season of Rick and Morty? That's blocking, and you quickly realize that non-blocking is something we live with all the time.
Being "non-blocking" from a server perspective is the ability to decouple processing time from service time; therefore, greatly increasing the serving capacity.
Bingo, it perfectly fits with the full-scale software industry transformation to microservices architecture. Fortunately, Spring Boot is already on the case with its self-contained model and we want to offer new type of Boot apps, ones that are resource-efficient under concurrent access. Nowadays, users paint a different functional problem with each Boot app—a real challenge when it comes to aggregating other (Boot) microservice results. It's easy to mix remote access latency into processing time, and ultimately into serving time itself. Again, Reactive programming is about decoupling all of these times so the app does something else while it waits for a result. The app becomes 100% available because it never prevents servicing.
Microservice-based architectures are a major use-case Spring had waited for to expose to the this matured reactive programming model. Three years ago, the Spring Framework team and my team—an incubated initiative called Project Reactor—looked into supporting the emerging "Reactive Streams" standard within the Spring ecosystem. You probably know that Spring Framework is all about integrating, so the idea of a standard around reactive programming echoed well with us.
Reactor had some success in being an extremely efficient asynchronous library, yet it lacked a comprehensive domain to build on. Thanks to the RxJava community lead, David Karnok, not only did we work on game changing improvements, but we pushed Reactor 3's API into a de facto industrial standard: ReactiveX. Yet, our singularity comes from our focus on the new Reactive Streams standard with Java 8 and onward. Now, Reactor 3.1 is the official polished version and the product of many refinements. It is certified to support the needs of the new Reactive Spring initiatives including Spring Framework 5, Spring Boot 2, Spring Cloud, Spring Data, and even Spring Security.
These now reactive-ready Spring modules will help you build your next Spring Boot app fully reactive, connecting with each other using Reactor. As soon as Chapter 2, you will be progressing into the reactive space with concrete and well-known web examples. You will find the same web conventions Spring Framework has standardized over a decade to quickly reduce your knowledge gap with these updates. Chapter 3 will complete this tour with data access as you play with the Spring Data reactive support.
Greg has pragmatically shaped these sections to give you enough context for every subsequent reactive update introduced in this book or beyond. If you master chapters 1-3, you master them all, and I am confident that your readiness for these new patterns will bring you where you want. Efficient microservices? Mobile backends? Internet of Things? Function-as-a-Service? You name it. All these use cases share one concern: a critical need for connection scalability and resources efficiency.
Stéphane Maldini
Lead developer, Project Reactor
When the first edition of Learning Spring Boot hit the streets, it was still early days. Anyone who picked up Spring Boot and started using it was immediately hooked, but not everyone did, and the book was a nice tool in driving adoption. Now, however, we are in a different phase of the life of the project. The Spring community is huge and diverse, but practically all of them now see Spring Boot as the best way to use Spring and the best way to write applications on the JVM. There are Spring Boot applications that have been in production for almost 4 years. Download numbers just grow month after month, so more and more people are using it for more and more things. The feature set of Spring and Spring Boot has grown, probably by a factor of two or more.
So, the time is ripe for a second edition. The content has been expanded and updated to cover the newest parts of the framework, and, just like Spring Boot itself, it tracks the latest developments in all the third-party libraries that people use in Spring applications. Greg has done a great job again of juggling his commitments to the Spring engineering team with his authoring, so the book is full of insights from a privileged viewpoint, as well as being a great practical tool to get off the ground with Spring Boot. His voice is authoritative, yet informal, so I hope it reaches an even bigger audience.
A book for first time users is an interesting angle. It should be valuable for anyone who wants to start using Spring or Java, but also for those already comfortable with the technology, and who want to learn about the newest features in Spring 5.0 and the entire new generation of Spring project releases that are coming down the pipe.
Dave Syer
Co-Lead, Spring Boot