Skip to content

Commit

Permalink
Release v1.2.1
Browse files Browse the repository at this point in the history
chore-be: Hikari CP 설정 최적화 적용사항 변경(#918)
  • Loading branch information
Dobby-Kim authored Oct 23, 2024
1 parent 7edb38e commit 6ade3b7
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 30 deletions.
4 changes: 2 additions & 2 deletions backend/src/main/java/com/cruru/config/DataSourceConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ public DataSourceRouter routeDataSource() {
}

@Bean(name = WRITE_DATASOURCE)
@ConfigurationProperties(prefix = "spring.datasource.write")
@ConfigurationProperties(prefix = "spring.datasource.write.hikari")
public DataSource writeDataSource() {
return DataSourceBuilder.create()
.type(HikariDataSource.class)
.build();
}

@Bean(name = READ_DATASOURCE)
@ConfigurationProperties(prefix = "spring.datasource.read")
@ConfigurationProperties(prefix = "spring.datasource.read.hikari")
public DataSource readDataSource() {
return DataSourceBuilder.create()
.type(HikariDataSource.class)
Expand Down
64 changes: 38 additions & 26 deletions backend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ spring:
enabled: true
datasource:
read:
jdbc-url: jdbc:h2:mem:database;MODE=MySQL;
hikari:
jdbc-url: jdbc:h2:mem:database;MODE=MySQL;
write:
jdbc-url: jdbc:h2:mem:database;MODE=MySQL;
hikari:
jdbc-url: jdbc:h2:mem:database;MODE=MySQL;
flyway:
enabled: false
jpa:
Expand Down Expand Up @@ -81,15 +83,17 @@ spring:
on-profile: dev
datasource:
read:
jdbc-url: ${DB_URL}
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${DB_USER}
password: ${DB_PASSWORD}
hikari:
jdbc-url: ${DB_URL}
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${DB_USER}
password: ${DB_PASSWORD}
write:
jdbc-url: ${DB_URL}
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${DB_USER}
password: ${DB_PASSWORD}
hikari:
jdbc-url: ${DB_URL}
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${DB_USER}
password: ${DB_PASSWORD}
flyway:
enabled: true
baseline-on-migrate: true
Expand Down Expand Up @@ -178,15 +182,19 @@ spring:
on-profile: test
datasource:
read:
jdbc-url: ${DB_URL}
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${DB_USER}
password: ${DB_PASSWORD}
hikari:
jdbc-url: ${DB_URL}
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${DB_USER}
password: ${DB_PASSWORD}
maximum-pool-size: 10
write:
jdbc-url: ${DB_URL}
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${DB_USER}
password: ${DB_PASSWORD}
hikari:
jdbc-url: ${DB_URL}
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${DB_USER}
password: ${DB_PASSWORD}
maximum-pool-size: 5
flyway:
enabled: true
baseline-on-migrate: true
Expand Down Expand Up @@ -273,15 +281,19 @@ spring:
on-profile: prod
datasource:
read:
jdbc-url: ${READ_DB_URL}
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${DB_USER}
password: ${DB_PASSWORD}
hikari:
jdbc-url: ${READ_DB_URL}
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${DB_USER}
password: ${DB_PASSWORD}
maximum-pool-size: 10
write:
jdbc-url: ${WRITE_DB_URL}
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${DB_USER}
password: ${DB_PASSWORD}
hikari:
jdbc-url: ${WRITE_DB_URL}
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${DB_USER}
password: ${DB_PASSWORD}
maximum-pool-size: 5
flyway:
enabled: true
baseline-on-migrate: true
Expand Down
6 changes: 4 additions & 2 deletions backend/src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ spring:
enabled: true
datasource:
read:
jdbc-url: jdbc:h2:mem:database;MODE=MySQL;
hikari:
jdbc-url: jdbc:h2:mem:database;MODE=MySQL;
write:
jdbc-url: jdbc:h2:mem:database;MODE=MySQL;
hikari:
jdbc-url: jdbc:h2:mem:database;MODE=MySQL;
flyway:
enabled: false
jpa:
Expand Down

0 comments on commit 6ade3b7

Please sign in to comment.