Using C# to create Realm functions

Our team is 99% C# oriented. We are super productive building backends with C#. Even though realm functions are pretty powerful, they have a major drawback - they are JavaScript. Our performance is pretty awful in JavaScript. We were thinking about ways of how we could utilize our C# expertise in building realm functions instead of using JavaScript.
Well, the best way would have been if Realm Functions supported C# code out of the box. I guess that’s not a reality either now or in the near future right?
The second way I was thinking is using realm functions as a proxy to our C# custom backend that would use Realm.NET to get the job done. However, there are some things that I am not quite sure about.

  1. The architecture I was thinking about is each function would basically do an HTTP call to the corresponding API in our backend and forward the result to the calling user. Does this sound like a good strategy?
  2. Latency - let’s say we use MongoDB Atlas on Azure infra. We deploy our code in the same azure region and infra (probably an app service or Azure functions), I wonder if that’s going to be fine or no. Perhaps the answer to this question is just go ahead and try. If the latency is acceptable then go for it. But I would really love to know if someone has already done something similar
  3. Will I be able to achieve everything possible using JS functions using .NET SDK? Considering how implicit JS is, and how explicit .NET is, will I face any issues in terms of data contract incompatibilities?

One option is that you could run your C# code in AWS Lambda functions and then execute them via the AWS service that’s built into Realm. https://docs.mongodb.com/realm/services/aws/