How to share database sessions in FastAPI without connection leaks?
Question
Asked45 days ago
Viewed63 times
20
I'm working on **FastAPI** and need to share database sessions. I've tried a simple cache layer, but I'm still seeing connection leaks.
Context:
- Dataset size: small startup
- Expected output: p95 < 200ms
- Current behavior: timeouts under load
What would be a clean approach here, and what should I watch out for?