I have trouble understanding when Stitch creates a new connections to Atlas.
I have noticed the following:
1. Using watch([id]) always creates a connection and holds it until the change stream is closed. Even if I have 20 clients watching the same document id, this will create at least 20 connections and hold them until the change stream is closed.
2. Calling multiple Stitch functions from one client creates more than one connection, but later those connections are automatically closed.
3. Opening 10 clients that call multiple function, creates less than 10 connections, holds them for some time and then automatically closes some of them, but not all.
My questions are:
1. Is there anywhere a documentation explaining when and why connections are created? Could someone explain?
2. Couldn't watch([id]) function be improved if the same document is being watched by multiple clients ? One connection should be enough, right?
3. If we assume that I have a quota of 100 connections and 200 users open my website at the same time, calling several functions at the same time, how many connections will be opened ? Would the request fail ?
4. Does stitch reuse connections when quota is reached?
Any help is welcome.
Br,
Dimitar