586 karma · joined February 8, 2013
https://github.com/jaws-framework/JAWS
contact: austen [at] jawsframework.com
http://www.slideshare.net/AmazonWebServices/dvo209-jaws-a-sc...
The following real life scenario below portrays an administrative API layer that runs in EC2, and how it compares to what the raw hardware costs would be in Lambda. It purposefully excludes anything to do with requests (CloudFront+ELB for EC2 and API Gateway for Labmda).
EC2 scenario: 2 c3.large instances, general purpose 15GB SSD (need two for HA, span AZs) 1 Yr All upfront reserved pricing on both instances
Lambda scenario: 1042 memory size Workload running on EC2: 16000 requests a day to an endpt. 200 ms ave = 3200000 ms total
3200000 / 100 ms = 32000 segments of 100 ms
EC2 Cost: 1084(yr)/365 = $2.96986301369863/day
Lambda Cost: 32000 * 0.000001667 = $0.053344/day
The cost difference is so large because this workload is not a very high EC2 utilization scenario. We need extra servers for multi AZ HA and to handle bursts. Lambda handles both of these for you.
This also does not include the huge costs savings of no server management (security patches etc) that go into EC2 or Docker containers.
JAWS generates scaffolding to encourage this for you. As a result, your code ends up looking just like a traditional application framework's code.
I just did a talk on JAWS @ Re:Invent to over 600 people. The line was out the door. Honestly, I didn't hear "I'm only going to use this for a hackathon project" once, except for now. Instead, all I heard was, "OMG we don't have to deal with servers!!! We will use this for everything!!!". And there were huge enterprise companies there.
I'm a Docker lover, but Lambda has a huge head start in many areas. Super fast spin-up times, orchestration handled for you, the ability to containerize functions/endpoints not just applications, and pay per use pricing. All of this comes with Lambda out-of-the-box.
Instead, the developers deals only with Lambda, an event-driven compute resource. You upload your code and it runs when triggered, scaling horizontally and massively, out-of-the-box.
The workflow rocks because it's endpoint/function isolation, not just application isolation. Every piece of logic is in its own container. Best of all, you only get charged when that code is run (!!!).
My friend is refactoring an app at his company right now, using only Lambda via JAWS and we ran some numbers on the cost savings. He's retiring 2 EC2 c3.large instances which were costing $2.97/day. On Lambda the app will cost $0.05/day.
We don't hear about it nearly enough yet, but the cost savings of building apps on Lambda are huge. Then you add in the time saved on devops... and you realize how seriously disruptive this tech is.
I'm a huge fan of CRISPR. I've been following it closely since I heard Radiolab's podcast about it.
I'm also the founder of the JAWS framework, which is an open-source application framework built entirely on AWS Lambda and AWS API Gateway: https://github.com/jaws-framework/JAWS
I would LOVE to grab a coffee with you or anyone on your team some time, and chat about lambda or CRISPR, or anything really :) I live in Oakland and my email address is austen[at]servant.co
Also, will you be at Re:invent? I'm doing a breakout session on JAWS and I'll be there all week.
Good luck to you!
Austen
People interested in this should also check out JAWS: The Server-Less Framework Powered By AWS Lambda.
JAWS V1 is coming out in a few weeks and it is insanely awesome.
AWS Pop-Up Loft
AWS has an office/loft in downtown San Francisco where you can meet with an AWS engineer for free to discuss your project and your use of AWS services. It's an incredibly valuable resource, but I don't think many people know about it.
All you have to do is schedule a meeting in advance. Meetings can last up to 1 hour and can be scheduled M-F during normal business hours.
Further, their office and loft is also a free co-working space, as long as you are using AWS services. They have some nice couches and desks and it's a great way to network with other developers who use AWS services.
Again, all of this costs nothing. If you're in SF, or traveling there, check it out!
To get around execution time limits, invoke another Lambda within your current Lambda function.
While AWS continues to improve Lambda performance (it's still early tech), I've started an "Optimization" section in the wiki, detailing how everyone can get better performance out of JAWS.
Further, JAWS is optimized for AWS Lambda performance.
Swagger JSON can be imported to create/update your REST API instantly via AWS API Gateway.
Meaning, you can still do larger, versioned roll-outs by simply updating the JSON in your Swagger file.
This will give beautiful structure and simplicity to the JAWS workflow.
The single deployable server you advocate is a single point of failure.
We'll get there!
For now, I favor the traditional REST API layer because REST APIs are well understood. They also may require less effort to access via IOT devices and expose publicly for other developers to hack with.
Overall, I'm interested in the best. If you have thoughts on how to incorporate this approach into JAWS for optimal effect, I'm definitely paying attention.
As far as JAWS goes, the next step is to be able to define your API in JSON via Swagger, and then import it into AWS API Gateway to instantly create/update your API. This should dramatically reduce development time and make it much easier for everyone building their JAWS REST API :)
I'm not affiliated with Amazon, nor do I know anyone over there. I'm a freelancer in Oakland, CA., and my goal is merely to offer some open source code to help people take advantage of emerging tech so that they can build ridiculously cheap and scalable web apps.
It's going to get crazy up in here...
That plan hasn't changed! Just need to find more time for open-source projects :P
AWS introduced API Gateway because they want back-ends being built on AWS Lambda. They will raise the limits, but this is all bleeding-edge tech and they are likely moving forward with caution.
You pay for EC2/DO even if your app isn't used. With JAWS, you pay only when your app is used.
Here is Lambdas pricing FYI: https://aws.amazon.com/lambda/pricing/
But seriously, there aren't any servers. There is a local development server included, to help you code your web site locally. But, it's not a server you use for production.
Much of my time as a developer is spent deploying/configuring/monitoring/managing/scaling/paying for servers. I'm tired of that. Further, I'm broke. AWS Lambda and on-demand cloud computing in general can reduce and eliminate a lot of that.
Much love for servers, much love for containers, but AWS is putting out technologies that are more efficient. The goal of JAWS is to help everyone take advantage of this new tech.
Could you share some of your gulp optimizations so that I can incorporate them into the project?
You don't have to share their code if you don't want to, but if you could write down what the gulp tasks are, I could incorporate them into the JAWS Command Line Interface.
Thanks for the positive feedback btw :)
I'm also using API Gateway + Lambda + DynamoDB
All of them are very slow on first request, even the DynamoDB queries. After that, they're much quicker, unless there are maybe 5 mins of inactivity.