Software Design

Database Connection Pool Lifecycle Under Saturation

UML Sequence Diagrams · made in Skemio

UML sequence diagram showing App Thread checking out a connection from Connection Pool, executing a SQL query on Database, and returning it.
UML sequence diagram showing App Thread checking out a connection from Connection Pool, executing a SQL query on Database, and returning it.

What it shows

  • HikariCP/pgx borrows active sockets instead of paying TCP/TLS handshake costs.
  • When saturated, threads block on a queue until connectionTimeout triggers.
  • Returning a connection resets dirty state without destroying the socket.

The takeaway

Connection pools prevent database exhaustion by buffering thread spikes into controlled queues.

More uml sequence diagrams