Chapter 17. Reactive programming
- Defining reactive programming and discussing the principles of the Reactive Manifesto
- Reactive programming at the application and system levels
- Showing example code using reactive streams and the Java 9 Flow API
- Introducing RxJava, a widely used reactive library
- Exploring the RxJava operations to transform and combine multiple reactive streams
- Presenting marble diagrams that visually document operations on reactive streams
Before we dig into what reactive programming is and how it works, it’s helpful to clarify why this new paradigm is of growing importance. A few years ago, the largest applications had tens of servers and gigabytes of data; response times of several seconds and offline-maintenance times measured in hours were considered to be acceptable. Nowadays, this situation is changing rapidly for at least three reasons:
- Big Data— Big Data usually is measured in petabytes and increasing daily.
- Heterogeneous environments— Applications are deployed in diverse environments ranging from mobile devices to cloud-based clusters running thousands of multicore processors.
- Use patterns— Users expect millisecond response times and 100 percent uptime.