R2DBC Revealed: Reactive Relational Database Connectivity for Java and JVM Programmers

  • 2h 9m
  • Robert Hedgpeth
  • Apress
  • 2021

Understand the newest trend in database programming for developers working in Java, Kotlin, Clojure, and other JVM-based languages. This book introduces Reactive Relational Database Connectivity (R2DBC), a modern way of connecting to and querying relational databases from Java and other JVM languages. The book begins by helping you understand not only what reactive programming is, but why it is necessary. Then building on those fundamentals, the book takes you into the world of databases and the newly released Reactive Relational Database Connectivity (R2DBC) specification.

Examples in the book are worked using the freely available MariaDB database along with MariaDB’s vendor-implementation of the R2DBC service-provider interface (SPI). Following along with the examples and the provided example code helps prepare you to work with any of the growing number of R2DBC implementations for popular enterprise databases such as Oracle Database and SQL Server. You’ll be well prepared for what is becoming the future of database access from Java and other languages built on the JVM.

You will:

  • Understand why R2DBC was created and how it utilizes the Reactive Streams API
  • Understand the components of the R2DBC service-provider interface
  • Create and manage reactive database connections and connection pools using an R2DBC client
  • Programmatically execute queries on a relational database using an R2DBC client
  • Effectively utilize transactions using an R2DBC client
  • Build relational database-driven applications that are event-driven and non-blocking

About the Author

Rob Hedgpeth is a professional software engineer and developer relations enthusiast residing in the bustling metropolis of Chicago, Illinois. Rob has more than 12 years of professional development experience, primarily in the application development space. Throughout the years he has contributed to the architecture and development of many apps, using a large array of languages and technologies. Now as a developer advocate and evangelist for MariaDB, Rob gets to combine his love for technology with his mission to fuel developers' curiosity and passion.

In this Book

  • The Case for Reactive Programming
  • Introduction to R2DBC
  • The Path to Implementation
  • Connections
  • Transactions
  • Statements
  • Handling Results
  • Result Metadata
  • Mapping Data Types
  • Handling Exceptions
  • Getting Started with R2DBC
  • Managing Connections
  • Managing Data
  • Managing Transactions
  • Connection Pooling
  • Practical Applications with Spring Data and R2DBC