4 ms·
Having the possibility to create an HTTP RESTful interface to many Lambda functions running on AWS is the biggest advantage of the AWS API Gateway. Technically
by fosk 11y ago
Having the possibility to create an HTTP RESTful interface to many Lambda functions running on AWS is the biggest advantage of the AWS API Gateway.
Technically, stretching the system a bit, one could argue that we don't need backend software running on EC2 anymore, since everything can be a Lambda function with an associated HTTP endpoint to trigger it. I have been thinking about this a lot, and it could work if being locked into AWS is considered an acceptable risk.
For anything else more API-oriented (more authentication schemes, better security, more logging options, etc) I would suggest checking out Kong (https://github.com/Mashape/kong https://github.com/Mashape/kong), which is pluggable with extra functionality and can work in front of the AWS API Gateway to enhance the REST-to-Lambda interface (and with any other API).
- maratd 11y ago> I have been thinking about this a lot, and it could work if being locked into AWS is considered an acceptable risk. This is a huge risk. If they shut you out, for whatever reason, you're done. You can't port your code to somewhere else. It's Lambda specific.
- wnevets 11y ago>You can't port your code to somewhere else. It's Lambda specific. is that really true tho? Its just a function that does work from a request and send the result off to some where else.
- fosk 11y agoYou won't be able to port it without any additional work, but if you are willing to do some refactoring (specifically removing the Lambda-specific objects, etc) then it can run anywhere. Of course the time this will take depends on the size of the project, but it can be definitely done without rewriting the whole application, but just rewriting the "invoker" part. To make a future port easier, the functions could also be modularized by keeping the real business logic and the Lambda integration separate, but integrated.
- wnevets 11y agohow many Lambda-specific objects are there besides the context promise?
- ac360 11y agoI appreciate Kong. But we are here because we don't want to deal with servers!
- sinzone 11y agoYou don't. Kong (gateway) + AWS/DigitalOcean (the servers).