2

we use in our backend AWS Aurora which has two instances, one for read+write-access and one only for read access.

In our backend we use Spring data JPA to manage our Entities in the database. Would it now be possible, that spring will use the read node for selecting data and the read/write node only for write operations?

How could we configure that? Therefore the read instance has another hostname this instance do nothing.

Thx.

Gerrit
  • 2,515
  • 5
  • 38
  • 63
  • 1
    this might help:https://www.baeldung.com/spring-data-jpa-multiple-databases – Harish Gupta Jul 27 '19 at 08:51
  • check this one: https://stackoverflow.com/questions/4386130/how-to-setup-hibernate-to-read-write-to-different-datasources/33169879 – Harish Gupta Jul 27 '19 at 08:54
  • you need to sync database, now what if data needs to be persisted and since other one is read only? Either you are not sure why you have 2 database or something is really wrong with your **Architecture** – bananas Jul 27 '19 at 09:04
  • The second instance is a replica of the write instance. https://aws.amazon.com/de/rds/details/read-replicas/ – Gerrit Jul 27 '19 at 09:06
  • Does this answer your question? [How to setup Hibernate to read/write to different datasources?](https://stackoverflow.com/questions/4386130/how-to-setup-hibernate-to-read-write-to-different-datasources) – Jens Schauder Jan 07 '20 at 06:18
  • @Gerrit Have you found any working reliable solution? – Sivaram Rasathurai Apr 05 '22 at 16:07

0 Answers0