Skip to main content

design-a-database-connection-pool

Design a database connection pool from database capacity, workload concurrency, transaction duration, timeouts, fairness, failover, and observability. Use when services contend for limited database sessions.

소스 정보

저장소
protosphinx/sphinxstack
최근 소스 활동
2026년 7월 29일 13:55
감지된 SKILL.md 언어
영어
스타
3
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
design-a-database-connection-pool
category
code
description
Design a database connection pool from database capacity, workload concurrency, transaction duration, timeouts, fairness, failover, and observability. Use when services contend for limited database sessions.
# design-a-database-connection-pool ## When to use - Use for application, proxy, worker, or multitenant database access. - Do not multiply a per-process maximum without fleet-wide capacity math. ## Preconditions - Measure database limits, instances, replicas, services, concurrency, query duration, transactions, and failover. ## Procedure 1. Allocate a fleet-wide connection budget with reserve for operations and recovery. 2. Size per workload from measured concurrency and service objectives. 3. Define acquire, connect, query, transaction, idle, and lifetime timeouts. 4. Reset session state and prevent leaked transactions or tenant context. 5. Add fairness, backpressure, cancellation, health, and failover handling. 6. Test peak load, slow query, failover, scale-out, leak, and recovery. ## Failure plan - Shed or queue bounded work before exhausting database control capacity. ## Worked example Autoscaling doubles instances, so the per-instance pool shrinks to preserve the database-wide budget. ## Done - A pool design report records capacity, allocation, timeouts, lifecycle, fairness, reset, failover, and telemetry - Fleet, scale, leak, slow-query, tenant-state, failover, reserve, and recovery tests verify safety
GitHub에서 보기