Changes between Version 1 and Version 2 of Advanced Application Development


Ignore:
Timestamp:
02/21/26 20:39:19 (7 days ago)
Author:
231035
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Advanced Application Development

    v1 v2  
    254254    }
    255255}}}
     256== Pooling
     257In the backend layer of the Petify application, we use Spring Boot with Spring Data JPA to communicate with the PostgreSQL database. Because of this architecture, database connections are not created manually. Instead, they are automatically managed by HikariCP, which is the default connection pool implementation in Spring Boot.
     258[[BR]]
     259HikariCP is included transitively through:
     260{{{spring-boot-starter-data-jpa}}}
     261[[BR]]
     262Therefore, no additional configuration is required to enable pooling.
     263[[BR]]
     264In this project, we use these HikariCP configuration values:
     265{{{
     266spring.datasource.hikari.maximum-pool-size=20
     267spring.datasource.hikari.minimum-idle=5
     268spring.datasource.hikari.connection-timeout=20000
     269spring.datasource.hikari.idle-timeout=300000
     270spring.datasource.hikari.max-lifetime=1200000
     271spring.datasource.hikari.auto-commit=true
     272}}}
     273These values mean:
     274* A maximum of 20 database connections can be active at the same time.
     275* The pool maintains 5 idle connections ready for immediate use.
     276* If all connections are busy, a request waits up to 20 seconds before failing.
     277* Idle connections are kept alive for up to 5 minutes.
     278* Connections are refreshed every 20 minutes to avoid stale connections.
     279* Auto-commit is enabled by default.