AWS Lambda Makes Serverless Applications a Reality
techcrunch.com
techcrunch.com
It's awesome!.. Until you have to deal with the cold start issue. Our first call takes about 1.5 seconds; and then all other calls take about 50-80ms.
Your container stays in cache about 5-10 minutes unless it is called back, there are no guarantees.
This micro service is not called often and for us 1.5 seconds is never acceptable.
https://github.com/jaws-framework/JAWS
Previous JAWS HN post ~4 months ago:
Deployment is easy too; I've got a two line bash script that zips the code then uploads it using the AWS CLI.
Versioning documentation can be found here - http://docs.aws.amazon.com/lambda/latest/dg/versioning-alias...
However, once you start using Lambda, like distributed system, testing becomes a challenge if you are used to testing everything you own in one or two monolithic codebase. I wish someone could come up with a mock version of AWS :-)
custom docker image use came with the overhead of burning in your instances though which I don't think is publicly available yet on the service.
https://github.com/exratione/lambda-complex
Lambda Complex is a Node.js framework for applications that run entirely within Lambda, SQS, and other high abstraction layer AWS services. It is well suited to non-realtime content generation and other types of application driven by message queues and which require enforced concurrency limits. Examples include high volume generation of static content from data or other types of workflow initiated in response to messages placed into SQS queues.
[1] https://gist.githubusercontent.com/mpdehaan/d979252b9c69cfd1...
And here is an example: https://github.com/MitocGroup/deep-microservices-todo-app
Based on our experience, currently AWS Lambda is amazing for data / content / asset management use cases. Cold start is a known issue, which I hope AWS will solve sooner rather than later, because a lot of customers are complaining about it ;)
I'm thinking of the following workflow:
1. Write/debug with TypeScript -> ES6 on Node 5
2. Compile to a single file (not sure if I can use tsc or Babel for this -- basically just inline all the imports)
3. Transpile the resulting single file to ES5
I'm not sure if it's going to work, though...
1. We write everything in ES6, following code styling from Airbnb - https://github.com/MitocGroup/javascript
2. Every Lambda is separate npm package, therefore npm is managing all the dependencies; We include node_modules folder into the .zip file and upload it to AWS
3. Using Babel, transpile ES6 to ES5 - https://github.com/MitocGroup/deep-microservices-todo-app/bl...
4. To support 0.10.x, we're requiring Babel Polyfill - https://github.com/MitocGroup/deep-microservices-todo-app/bl...
As anticipated, the performance is not the best one, but functional for some of our use cases where time is not a constrain. That's why the combination with Amazon ECS is perfect complimentary match when AWS Lambda doesn't perform well, as required by the application.
My cofounder wrote a tool to help manage Lambda deployments: https://github.com/garnaat/kappa/tree/python-refactor
[0] Well as much as we can. We're building a Slack bot right now so we still need a container running under ECS to maintain the connection to Slack.
* I love that I don't have to provision any resources. The fact it will scale to volume automatically is a huge win.
* Lambda was a treat to work with. We used it with Python. Both the web console and API interface worked great for us.
* I was able to get Lambda development working end-to-end with a Makefile and the AWS CLI.
* API Gateway was a bear to work with. The concepts are unintuitive, the interface sucks, and the logging is lackluster. I found it difficult to go through the develop/test/deploy cycle on because of these issues.
* API Gateway is brand new. Brand new AWS services have bugs. We hit bugs.
* API Gateway documentation is awful.
* API Gateway had a bug where it stopped logging. If it doesn't log, it is literally impossible to debug. This hard-stopped development for 5 days while they worked on a fix.
* There's an invisible error case where your API doesn't have permissions to invoke the Lambda command. It's easy to hit and annoying.
* API Gateway doesn't support POST requests in the way you would expect. This leads to over-complicated setups for simple use cases.
* I really don't prefer the way mapping templates work in API Gateway.
Overall, our setup is humming along nicely, but it's just 2 routes. I just reviewed the Gist and I agree with many of the concerns expressed in it.
As I've been programming an Alex backend I haven't really run into the cold start issues.
I have to admit this sort of Dashboard Driven Programming is quite alien, but there are benefits.
Quote - Serverless doesn’t mean servers are no longer involved. It simply means that developers no longer have to think "that much" about them. Computing resources get used as services without having to manage around physical capacities or limits.
Sometimes you have several "devops" people in a small team dealing with orchestrating these "serverless" deployments so as to reduce latency etc.
We're also using this at mParticle Inc. to allow anybody to add themselves as an integration[2]. The point being that Lambda is a super-easy way to write _some_ server logic, even if it only serves as a proxy to something more complex.
[1] https://developer.amazon.com/public/solutions/alexa/alexa-sk...
I've never used Heroku before and got a production ready API out the door in no time.