What is the difference between mongodb atlas triggers and mongodb realm functions…
Seems there is a lot of overlap? Both are functions as a service, the former doesn’t seem to allow for HTTP triggers and only database triggers and crob jobs. VS realm does.
Are realm and triggers functions globally distributed? i could not find this information
Can I customize HTTP trigger domain names for realm? Currently, the default webhook URL is webhooks.mongodb-relam/api.xxxx
What are the limits of the functions? and charges? are these all aws lambda functions behind the scenes?
Hi @Rishi_uttam, I’ll try to answer your questions…
A Realm Trigger is a way to automatically invoke a Realm Function.
When you create a new Realm app, you can open the advanced configuration settings and select whether the app should be global or local to a specific region
Not that I’m aware of
No, Realm functions aren’t using Lambda. They’re lighter weight than Lambda and designed to be run frequently. You can find pricing details here… https://docs.mongodb.com/realm/billing/
I have set my realm app set to Global, but writes are restricted to one location (currently Singapore) . Does this mean that all reads from my app (including functions & HTTP functions) are read form the database that is served from atlas edge locations? thats great, then they dont need to route back the write origin. Are realm locations the same as Atlas locations?
My mongob database with atlas is hosted on Azure (Hong Kong region) but realm database writes are in Singapore… ??. but my app is using the same collection in the same database? if you could point me to a document to explain why the realm database is different form the atlas database that may help to claify things? i know many of us are confused about this point.
Triggers are functions that have special hooks. That’s the main difference… you can specify that the code in your trigger function gets executed whenever a document is added, updated, or removed. There seems to be overlap for sure… but it’s just in the functionality around the triggered action.
Not sure I know what you mean? Triggers and functions are attached / connected to a specific Atlas Database. What is your concern around distribution of the trigger or function?
No - you can’t add a custom domain to an api call to my knowledge. This shouldn’t be exposed as an user-facing end-point… you typically reference those api calls in your code. Curious why you would want to add a custom domain?
MongoDB Realm applications (functions, triggers included) are billed according to how much they’re used on a monthly basis. There are four independently-measured usage types that determine how much you pay each month… more information is available here: https://docs.mongodb.com/realm/billing/
in my client side app, i am making fetch calls to realm http 3rd party http triggers so the user does see the xhr origin in the browser status bar, was hoping to put it under our domain (like you do in lambdas)
Realms global reads i believe are in 4 locations currently, and writes are in 1. I seek low latency like everyone else hence its good that reads are automatically routed to the closet destination out of the 4 current locations.
noted on the pricing thanks.
Im still struggling with using a function to create a new user based on a incoming post request body’s username and password. I know realm functions get a context object, but where is the context.emailPasswordAuth.registerUser(email, password); do i need to import the realm node sdk in to the function? seems like i shouldn’t have to just like i dont need to import the mongodb module., its available in the context. coulnd’t find much in the documentation on this… thanks for your help.