shared-pool-pattern
CommunityEfficient shared DB pools for multi-service apps.
Software Engineering#FastAPI#Python#connection pooling#async database#shared pool#schema isolation#migration management
Authorjuanre
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill provides a proven pattern for sharing a single database connection pool across multiple services within a single application, reducing resource usage and connection overhead while preserving service isolation.
Core Features & Use Cases
- Single Shared Pool: Creates one pool at startup that is reused by all services.
- Schema-Isolated Managers: Each service gets its own manager with a dedicated database schema to avoid table conflicts.
- Per-Service Migrations: Independent migrations run per service module to keep schemas up to date.
- FastAPI Integration: Demonstrates how to wire the shared pool into FastAPI lifespans and dependency injections.
Quick Start
Initialize a shared pool at application startup, then create per-service managers with distinct schemas and run migrations.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: shared-pool-pattern Download link: https://github.com/juanre/pgdbm/archive/main.zip#shared-pool-pattern Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.