I’m new to meteor. Picked it up last night and made a simple hello world application for iOS, android, Mac desktop and ofcourse web. I loved it.
I picked up a project to learn Serverless over AWS and i pretty much built it in raw node js. I would like to convert that node js app into meteor. I have some modules that I would like to run as microservices over it. I have some architectural questions on it.
Should I keep the apis part in node js (seperate lambda) and run meteor over a lambda in React? or should i keep the meteor (server and client) folders in just one lambda and treat the entire frontend and backend of it as a microservice?
I would like to use mysql (Amazon RDS) with meteor app (if decided to go as microservice), so will that affect the real time sync over all the devices?
I’m not sure that Meteor was created to work as a severless app, as it uses a persistent websocket connection.
What we did:
For CRON jobs and some other microservices we have AWS API Gateway and AWS Lambda. The main app is our Meteor app, and in AWS, we have pure nodejs servers.
You’ll lose reactivity but there is nothing stopping you from making rest calls to Lamda functions if that’s what you wanna do.
Checkout the HTTP API
You might also want to investigate Apollo for use cases where you want to augment the default Meteor set up yet still want reactivity.
If you’d wanted serverless and Meteor-like reactivity you could choose Google’s firestore
If you want serverless + reactivity, the best option seems to be the new AWS AppSync, coupled with a db of your choice.
How do you authenticate from a Meteor method to AWS API Gateway and AWS Lambda?
LOL just seeing this now - couldn’t the authorizer be made to understand the Meteor login token, pull whatever profile info it needs from the mongo db to understand permissions then make that info available to the target function?
I suppose we could cache some of the profile stuff pulled from mongo for a reasonable TTL to boost performance.
What do u think?
Jan Kuester did a talk on using meteor for API’s