Connection Pool
When your server handles many concurrent requests, a single database connection becomes a bottleneck.PrismConnectionPool manages a pool of SQLite connections, lending them out to requests and returning them when done.
Why Pool?
Without a pool, every concurrent request either:- Shares one connection — serializing all database work, killing throughput
- Opens its own connection — expensive setup cost per request, risk of hitting file descriptor limits
Basic Setup
Creating a Pool
The pool starts with one connection and creates new ones on demand up to
maxConnections. When all connections are busy, new requests wait until one is released.Using Connections
Automatic (Recommended)
withConnection Pattern
Manual
Manual Acquire/Release
Pool Monitoring
Pool Status
Server Integration
Pool with Route Handlers
Sizing the Pool
WAL Mode for Better Concurrency
Enable Write-Ahead Logging for concurrent reads during writes:Enable WAL Mode
Health Check Integration
Combine with the health monitoring system:Database Health Check