Expand description
§Database Pool
This is the docbox solution for managing multiple database connections and connection pools for each tenant and the root database itself.
Pools are held in a cache with an expiry time to ensure they don’t hog too many database connections.
Database pools and credentials are stored in a Tiny LFU cache these caches can be flushed using DatabasePoolCache::flush
§Environment Variables
DOCBOX_DB_HOST- Database hostDOCBOX_DB_PORT- Database portDOCBOX_DB_CREDENTIAL_NAME- Secrets manager name for the root database secretDOCBOX_DB_MAX_CONNECTIONS- Max connections each tenant pool can containDOCBOX_DB_MAX_ROOT_CONNECTIONS- Max connections the root “docbox” pool can containDOCBOX_DB_ACQUIRE_TIMEOUT- Timeout before acquiring a connection failsDOCBOX_DB_POOL_TIMEOUT- Maximum time a connection can live in the cache forDOCBOX_DB_IDLE_TIMEOUT- Timeout before a idle connection is closed to save resourcesDOCBOX_DB_CACHE_DURATION- Duration pools can remain in the cache for untouched before they are closed and removedDOCBOX_DB_CACHE_CAPACITY- Maximum database pools to hold at onceDOCBOX_DB_CREDENTIALS_CACHE_DURATION- Duration database credentials should be cached forDOCBOX_DB_CREDENTIALS_CACHE_CAPACITY- Maximum database credentials to cache
Structs§
- Database
Pool Cache - Cache for database pools
- Database
Pool Cache Config - Config for the database pool
- DbSecrets
- Username and password for a specific database