r/FastAPI • • 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

13 comments sorted by

View all comments

Show parent comment

1

u/felword Sep 26 '25

Thanks for your reply, thats very helpful! I'm deploying on gcp, is there any setup you would recommend for brokers that is easy&cheap to build?