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
realmthe 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
realmor saved on the trigger inatlas. So the only actual difference comes from the configuration options, for example:atlastrigger can connect to multiple clusters whilerealmmust choose a single one.realmhas aprojectoption available.realmaccepts a function name (as it's already saved) whileatlasrequires the actual code saved. (If for some reason you want the same code executing for different triggersrealmis 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.