Posts

Showing posts with the label R2DBC

Google Cloud SQL for PostgreSQL + Spring Boot + Spring WebFlux + R2DBC - Building Reactive REST CRUD APIs

Image
In this section,  we will learn how to use Spring Boot, Spring WebFlux, and R2DBC to create a reactive web service that interacts with Google Cloud SQL for PostgreSQL. Reactive APIs are non-blocking and tend to be more efficient because they’re not tying up processing while waiting for stuff to happen. Reactive systems adopt asynchronous I/O. Reactive apps allow us to scale better if we are dealing with lots of streaming data.  If we are going to build a reactive app, we need it to be reactive all the way down to your database.  Spring WebFlux uses a library called Reactor for its reactive support. The Reactor is an implementation of the Reactive Streams specification. The Reactor Provides two main types called Flux and Mono. Both of these types implement the Publisher interface provided by Reactive Streams. Flux is used to represent a stream of 0..N elements and Mono is used to represent a stream of 0..1 element. 1.  A little bit of Background Google Cloud SQL for PostgreSQL Cloud SQL