Software Design

Database Connection Pool Resource States

State Diagrams · made in Skemio

State diagram showing database connection states: Idle, Borrowed, Validating, Active Query, Evicted, and Terminated.
State diagram showing database connection states: Idle, Borrowed, Validating, Active Query, Evicted, and Terminated.

What it shows

  • Idle connections consume memory and server file descriptors if kept open.
  • Connection validation prevents broken TCP pipes from causing 500 errors.
  • Pool starvation happens when borrowed connections fail to return promptly.

The takeaway

Connection pools protect your database; tune validation and eviction to prevent pool starvation.

More state diagrams