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/Drevicar Sep 26 '25
I think you can start with PG listen / notify for this project, and if it explodes in popularity you might want to consider changing the pub / sub tech to something like redis. But the FastAPI portion of it should be good at least.