Building a chat with MongoDB change streams

We are building a chat server with MongoDB using change streams. We run it in Kubernetes and want it to be able to scale horizontally. We have a couple of clients who wants to use it and it should be able to handle 50k+ users spread across a number of pods.

Currently, each client starts a new change stream that listens in a specific collection for his/her id. When a message is sent to the user, the change stream will find out and forward the message to the user.
I am not sure if this is a great solution and if MongoDB can handle 10k+ change streams per pod…
If not, do you guys have any recommendations on how to improve?

Also, I should mention that our MongoDB database is self-hosted in kubernetes and inside the same cluster as our chat-server.


PS. if you guys don’t mind, then give our pinned repositories a star - would mean a lot! :star:

Sorry, not each client but each user connected to the chat-server starts a change-stream… all events is forwarded to the user using a stream in gRPC.