https://github.com/coveooss/global-aurora-database-with-spring
https://github.com/coveooss/global-aurora-database-with-spring
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/coveooss/global-aurora-database-with-spring
- Owner: coveooss
- Created: 2022-02-10T14:33:34.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-24T17:35:24.000Z (9 months ago)
- Last Synced: 2025-03-21T15:54:13.885Z (3 months ago)
- Language: Java
- Size: 9.77 KB
- Stars: 1
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Global Aurora Database With Spring Boot
This is a small demo application showing how to use a Global Aurora database that has multiple clusters using Spring Boot.
A blog post explaining how it works can be found here:
[Using Amazon Aurora Global Databases With Spring](https://source.coveo.com/2022/02/21/global-aurora-database-with-spring/)To launch this demo application you need to:
- Edit the [application.yml](src/main/resources/application.yml) to specify your username, password and database endpoints.
- Launch the main in [GlobalAuroraDatabaseWithSpringApplication.java](src/main/java/com/coveo/globalauroradatabase/GlobalAuroraDatabaseWithSpringApplication.java)Once the app is running you can confirm that a connections to both data source was established by looking at the console logs.
You should see something like the following:
```
com.zaxxer.hikari.HikariDataSource : Primary-HikariPool - Starting...
com.zaxxer.hikari.HikariDataSource : Primary-HikariPool - Start completed.
org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MariaDB53Dialect
o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
com.zaxxer.hikari.HikariDataSource : Secondary-HikariPool - Starting...
com.zaxxer.hikari.HikariDataSource : Secondary-HikariPool - Start completed.
o.s.b.a.e.web.EndpointLinksResolver : Exposing 14 endpoint(s) beneath base path '/monitoring'
o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
```You can also check the monitoring metrics at [http://127.0.0.1:8080/monitoring/metrics/hikaricp.connections](http://127.0.0.1:8080/monitoring/metrics/hikaricp.connections) and confirm that both data source are present.