So both of them are part of MongoDB features that I think have common nature. In my case, every time a document is created or updated, it will trigger a function that will update the document field with Date.now()
timestamp.
It can be achieved using a trigger, but there are 2 ways to do it, and I am not sure which one is suitable to choose. What is the difference between MongoDB Realm Trigger and MongoDB Atlas Trigger? Advantages over each other?
Thank You
They are inherently similar. The best way to think of it is two different GUI's that uses the same(ish) backend code. Apart from authentication triggers that only exist on
realm
the other two types both work in similar ways.They are both "triggered" by the same event (type) wether it be a cron expression or a database event and they both execute a realm based function (either pre-saved in
realm
or saved on the trigger inatlas
. So the only actual difference comes from the configuration options, for example:atlas
trigger can connect to multiple clusters whilerealm
must choose a single one.realm
has aproject
option available.realm
accepts a function name (as it's already saved) whileatlas
requires the actual code saved. (If for some reason you want the same code executing for different triggersrealm
is more stable as updating 4 different triggers due to code change is not fun)You can compare the confirguration options yourself here for realm and here for basic trigger
I have personally haven't noticed a difference between the two (nor did I look that deep into it), I feel that Apart from inside knowledge from an engineer in Mongo that can spill the beans whether or not there's an actual performance different or if both triggers use the same code base there is not much to say on the subject.