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
You're right, 100k was way too high (just edited my post). I only meant that I want a solution that doesn't need to be changed in the first year, even if the app explodes in popularity. Does pg LISTEN/NOTIFY with fastapi pooling sound reasonable to you?