Live data from Hacker News

AWS Lambda as a back end for a single-page app

lg.io

41–50 of 77 posts

Re: AWS Lambda as a back end for a single-page app

#41
The real question here is still: why doesn't Amazon offer a GET interface to Lambda? It's so, so, so close. So almost. They offer POST (through a work-around with S3), why not GET?

That is the real destination. With lambda serving GETs, we can remove the "for a single page app" from the title. AWS is so close to fulfilling the promise of its cloud: let developers worry about code.

Re: AWS Lambda as a back end for a single-page app

#42

The real question here is still: why doesn't Amazon offer a GET interface to Lambda? It's so, so, so close. So almost. They offer POST (through a work-around with S3), why not GET? That is the real destination. With lambda serving GETs, we can remove the "for a single page app" from the title. AWS is so close to fulfilling the promise of its cloud: let developers worry about code.

Since lamba is already handling the backend api calls, couldn't you just host the html and js in s3/cloudfront and not have to host anything?

Re: AWS Lambda as a back end for a single-page app

#43

The real question here is still: why doesn't Amazon offer a GET interface to Lambda? It's so, so, so close. So almost. They offer POST (through a work-around with S3), why not GET? That is the real destination. With lambda serving GETs, we can remove the "for a single page app" from the title. AWS is so close to fulfilling the promise of its cloud: let developers worry about code.

It is a bit slow still. Jitsu[1], which starts unikernels is fast enough to do per request image booting, but Amazon seem to have a 1s cold start which is just a bit slow.

[1] https://github.com/mirage/jitsu

Re: AWS Lambda as a back end for a single-page app

#44
post #38
post #35

Naive question: how does his example differ from a server responding to HTTP requests, that would take a JSON event as an argument and return a json version of: "the value was: "+ event['key1'] I suppose the AWS wins in term of set up and easiness of deployment. Anything else?

It differs in that you don't have to worry about scaling up that HTTP server, or pay for the machine hosting that HTTP server. With Lambda, you only pay per requests, current rate is $0.20 per 1 million requests.

Is there also any limit on machine resources that a single request can use? I'm curious about cases in which requests might need non-trivial amount of computational power.

Re: AWS Lambda as a back end for a single-page app

#45
post #44
post #38

Earlier quoted context omitted.

It differs in that you don't have to worry about scaling up that HTTP server, or pay for the machine hosting that HTTP server. With Lambda, you only pay per requests, current rate is $0.20 per 1 million requests.

Is there also any limit on machine resources that a single request can use? I'm curious about cases in which requests might need non-trivial amount of computational power.

You pay for request time too, measured in 100ms increments. And you pay more for more CPU/RAM.

Re: AWS Lambda as a back end for a single-page app

#46
> The future is now, and it's using AWS Lambda

How is this different from what Azure Mobile Services and many others have been offering for the past 2 years? To me it seems the author is proclaiming Platform As A Service is entirely new (look, no spinning up AWS instances!) while this has been around for quite some time, just Amazon is getting into it more seriously recently.

Re: AWS Lambda as a back end for a single-page app

#47
post #39

"the future is now, and it's down because somebody used the secret key to drain the poster's bank account" To be sure, the author specifies that the IAM role being exposed here is only allowed to invoke the function. That's great for the security of the other resources on the account, but still allows a reasonably determined attacker to run up a Bill of Unusual Size quite rapidly. For instance, the rate limiter curre…

...and that's why CloudWatch allows you to set billing alerts.

You could even route a billing alerts (via SNS) back to a Lambda function, use it to set a flag, and run in a reduced capacity mode if this is a concern.

I always tell my audiences (I work for Amazon) that it should be possible to build a system where you know the actual cost of every web page you generate and every request you serve, and to make sure that each one has the ability to earn its keep (by ultimately driving revenue).

Re: AWS Lambda as a back end for a single-page app

#48
post #26
post #24

Earlier quoted context omitted.

I think it is 100 concurrent requests per account. That is pretty low IMO. I think it was intended for things that are CPU intensive and short-lived. If it needs to pull from a data store and process, it likely isn't a good idea for lambda to begin with, right? I agree, it is only really useful to use like this for certain scenarios.

All of those limits are typically to protect users from being over charged if they fat-finger something. Most limits like that can be lifted with a support ticket. I'm not sure if this is one of them but I think it's likely.

You are correct; that limit can be raised. Just ask!

Re: AWS Lambda as a back end for a single-page app

#49
post #31

How does the pricing compare with say X amount of tasks that run for 1 second each compared to what you could expect from 1 hour on a medium ec2 instance? EDIT: I see it offers "The Lambda free tier includes 1M free requests per month and 400,000 GB-seconds of compute time per month. " What is a GB-second ;)

Re: pricing -- good question I'm going going to test that. Re: gigabyte seconds: It's how much memory (RAM) you're using: 128mb RAM (lowest possible value) for 10s == 1 GB/s 1gb RAM for 1s == 1 GB/s I think it's a pretty clever way to (somewhat) directly correlate compute cost with power (energy). If you remember what John McCarthy said when he imagined that computing would be a public utility one day ( http://www.te…

Doesn't this terminology come from power utilities where a kilowatt hour is kW.h. as in kilowatt × hour. Not kilowatt / hour. So why is a GB second, a GB / second and not GB × second?

Re: AWS Lambda as a back end for a single-page app

#50
post #31

Earlier quoted context omitted.

Re: pricing -- good question I'm going going to test that. Re: gigabyte seconds: It's how much memory (RAM) you're using: 128mb RAM (lowest possible value) for 10s == 1 GB/s 1gb RAM for 1s == 1 GB/s I think it's a pretty clever way to (somewhat) directly correlate compute cost with power (energy). If you remember what John McCarthy said when he imagined that computing would be a public utility one day ( http://www.te…

Doesn't this terminology come from power utilities where a kilowatt hour is kW.h. as in kilowatt × hour. Not kilowatt / hour. So why is a GB second, a GB / second and not GB × second?

It is a GB x second -- I've just seen it written more commonly as GB/s. I think we need a better abbrv for it... gBs?
Post reply on HN