r/FastAPI • u/felword • Sep 26 '25
Question Realtime Sockets Scalability
Hi everyone,
I need to build real-time functionality for a chat application and I use postgresql+fastapi. My current approach to support real-time features would be a LISTEN/NOTIFY trigger in my db and a fastapi connection pooler since postgres limits direct DB connections to ~500. So each fastapi instance would support X websocket connections and manage them. Have you build anything similar that supports over 1k concurrent users? How scalable is this?
10
Upvotes
View all comments
Show parent comment
1
u/felword Sep 26 '25
Good point, and I have looked at CDC, however my problem is that rn we are shipping an MVP and don't want to over-engineer. For mid-term (maybe up to 10k concurrent users) can fastapi work? 10k with 500 direct db connections would mean a poolsize of 20, is that manageable?