Currently on our deployments we are using change streams mongoDB feature to be notified of modification of some collections.
In few words our application is design as following:
A process called “P1” that post into database a list of tasks (into a collection named “C1”),
A second process called “P2” which subscribes to change into this collection C1 to deploy additional processes called “PT(x)” which will have to perform the task
Each “PT(x)” process opens 2 change streams to be notified of any modification on the task configuration and its status.
The P1 process also opens a change stream on the “C1” collection to be notified of any modification on any task.
All of these change streams are concerning the same collection, but as I can have lot of PT(x) processes in parallel, the total number of change streams can be important.
HI @Jacques , there is no limitation on the number of change streams if you open them directly on MongoDB Atlas (without Realm Sync or Triggers). However high number of change streams may lead to high resource consumption. In MongoDB 5.1 there is an optimization that allows for more efficient execution of the distinct change streams.
e.g. my client (webapp) can have many users simultaneously listening to a particular collection, does that mean i can only have 5 concurrent connections? what counts towards the 5 limit? is it a call to .watch counted as 1?