it seems to take about 80-100ms, I need it much faster, is there another way of getting a handle to the collection from within the changeEvent function, as the change stream knows the collection its associated with ?
I think it’s the only solution here but these 2 lines of code shouldn’t take more than a few micro seconds I guess.
I guess you mean that the entire round trip takes about 80-100ms (trigger + exec the function + receive the result somewhere). To which I’m going to answer with a few questions: where is located your Atlas cluster and where is located the Realm App? Are they collocated in the same region? If you are using a global Realm App, I would suggest to use a local one instead, collocated in the same region or as close as possible to limit the latency impact on the overall response time.
Thank very much for the response Maxine, yes I mean the full round trip, we ran some tests and when we remove everything but get handle we got 80-100ms when we added back in everything else it only went up by a few ms. All our code is running in the one region Azure/London (uksouth). I’m new to realm I’m just using a realm function in a realm app, not sure how to tell if my realm app is local or global.
Thanks @MaBeuLux88_xxx … now i look… its defined a as global … didn’t know about that setting, its placed it in a totally different region … I’ll fix that to a local and try again … thanks again
I think you found already but it’s in the App Settings tab in your Realm app. As of today, Realm Apps can only be deployed in 7 regions. London isn’t one of them but you have Ireland (eu-west-1) which is fairly close and it should reduce the overall latency a lot already.
@MaBeuLux88_xxx thanks, its going to take a while as it appears you cant change the region. I’ll have to delete and re build my whole app connected to Ireland rather than currently Virginia … a valuable learning experience for me. Thanks again.
@MaBeuLux88_xxx Thanks for the info, could I trouble you once more, The problem I have is the Triggers_RealmApp is created automatically when I go into Atlas => Triggers => Add Trigger … it defaults it to Virginia, do you know how to change the default location when it creates the Triggers_RealmApp so I can create it in Ireland ?
Deploy your own Realm App (with the right region / settings) and then create the triggers & functions in there. Atlas Triggers are actually just triggers deployed in an auto-configured Realm App.
I don’t see the point of having this either to be honest… Just make a real Realm app is my advice !
I have raised this user experience issue to the Atlas team. They have a plan to improve this and make the Realm App settings editable so you can move it from one region to another.