Search code examples
mongodb-atlasmongodb-stitch

Limits on maximum parallel trigger executions of MongoDB Stitch


I am trying to use MongoDB Stitch for real-time analytics. The MongoDB Stitch documentation documentation states the following note:

Stitch limits the execution of trigger functions to a rate of 50 executions per second across all triggers in an application. If additional triggers fire beyond this threshold, Stitch adds their associated functions to a queue and executes the functions once capacity becomes available.

I am looking for more clarity on the statement above, and the questions are listed below:

  1. Is the limit of 50 executions per second is bound by the capacity of Atlas MongoDB instance?
  2. If an execution takes 2 seconds to process, does the limit of 50 executions per second still hold good?
  3. Is there an upper limit on the number of pending operations in the queue?

Solution

    1. The limit of 50 executions per second is just to protect Stitch and isn’t related to the Atlas instance size.
    2. The function execution time and the 50 executions per second aren’t really related. This is just trying to say that 50 jobs can be added to the queue every second which isn’t dependent on the amount of time a function takes to run.
    3. There is a max limit on the number of jobs that can be added to the queue, but it’s not really a max. Once it hits that limit it just begins to slow down adding jobs so that it gives the consumers time to catch up.