Spring Data R2DBC with PostgreSQL Database on Amazon RDS

Overview

Creating an RDS PostgreSQL Instance

  1. Log in to the AWS Management Console and open the Amazon RDS service.
  2. Create PostgreSQL DB instance on the right button.
Engine options, Template sections
Settings, DB instance sections
Database Connectivity section

Spring Boot App Setup

Database initialization

Let’s get to the code

Book.java
  • The id of an entity should be annotated with Spring Data’s @Id annotation.
  • Do note that we can not add @Entity (It’s not JPA)
  • The @Table annotation is optional.
  • Lombok is recommended to be used to avoid boilerplate code.
BookRepository.java

Test the REST API

  • GET all Book
get all book postman result
  • Create new Book
create new Book postman result

Conclusion

References

--

--

--

Software Engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Using Multiple Post Processing Profiles and Reflective Probes in Unity

AWS Step Function Tips and Tricks

Short snippets: SSH Port Forwarding

Let’s Talk about DevOps

Coding Pattern: Two-Pointers

NEAR Blockchain Developer Bootcamp.

Test Management and Bug Reporting

How to show Firebase Firestore Data in Flutter

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Eric Anicet

Eric Anicet

Software Engineer

More from Medium

Enable authentication and configure ActiveMQ in Java application

How to build your Spring Boot as deb in maven

Writing JPQL Queries with Spring Data

How to Secure a Spring Rest Service using Spring Aspect