Live data from Hacker News

Chalice: Python Serverless Microframework for AWS

aws.amazon.com

11–20 of 101 posts

Re: Chalice: Python Serverless Microframework for AWS

#11
post #2

Ok, I have seen the phrase "serverless" a few times recently. Can someone explain to me what it is (as I am pretty sure it involves a server - it runs on AWS ffs) and why I should want to use it? And most importantly, is it web scale?

It means it runs using AWS Lambda and allows access via the API Gateway... it's literally in the second sentence with links to explain what those technologies are. Lambda's are just units of code that run only On-Demand and without having to manage one or more EC2 instances or a container platform.

Also known as: an expensive and lazy way to make something work 'a little bit' until it gets too complex and times out.

Re: Chalice: Python Serverless Microframework for AWS

#12
post #6

AWS Lambda is cool and all, but aren't people doing the math on this? Lambda seems like a really expensive way to deliver almost anything. Likewise, the AWS API Gateway is expensive, but at least provides some additional capabilities. Lambda seems like its profitable niche would be very small; limited computing environment, very high cost (relative to almost every other way to host an API), and having to learn a whol…

What makes you say Lambda is more expensive than things like EC2? Obviously lambda is a hammer, not a swiss army knife - you shouldn't shoehorn it into your app just because it's the new tech on the block. But the use case isn't niche at all. We're using lambda for our service to ingest and process Hearthstone replays. An HTTP POST is sent to the API gateway, this triggers a lambda which parses a 0.5-2MB file, scrape…

"Let it be known that Lambda only supports python 2.7, not python 3, and that really frickin sucks. Get your shit together, Amazon."

Node 4 support came, what, a month ago? It's pretty ridiculous.

Re: Chalice: Python Serverless Microframework for AWS

#13
post #6

AWS Lambda is cool and all, but aren't people doing the math on this? Lambda seems like a really expensive way to deliver almost anything. Likewise, the AWS API Gateway is expensive, but at least provides some additional capabilities. Lambda seems like its profitable niche would be very small; limited computing environment, very high cost (relative to almost every other way to host an API), and having to learn a whol…

AFAIK Lambda is the only way to react to events on S3 buckets. A lot of what I've seen it used for is as a mechanism for kicking off a workflow off of a new item in S3.

Re: Chalice: Python Serverless Microframework for AWS

#14
post #6

AWS Lambda is cool and all, but aren't people doing the math on this? Lambda seems like a really expensive way to deliver almost anything. Likewise, the AWS API Gateway is expensive, but at least provides some additional capabilities. Lambda seems like its profitable niche would be very small; limited computing environment, very high cost (relative to almost every other way to host an API), and having to learn a whol…

I think the appeal of Lambda is that most services get zero-to-low usage, and so something which is "pay only for usage" may be a net win over dedicated computing resources if you use it for the right parts.

I've had a number of startup ideas that went nowhere, and it would've been handy to test & demo them without springing for the full $17/month for an EC2 t2.micro instance. Usually they have some key aspect that's prevented me from running them on Lambda (eg. you can't exactly run a hacked Node.js binary on Lambda, and sending push notifications from it requires going through SNS and adopting its API), but if I could run arbitrary code & third-party packages and pay for only the computing time I use, it's an attractive proposition.

In general you use AWS for convenience anyway - if you're concerned about minimizing costs, you can sometimes get 10x price/performance ratios by moving to dedicated hosting.

Re: Chalice: Python Serverless Microframework for AWS

#15
This is awesome - it takes care of a lot of the pain of setting up Lambda, including the packaging, the tricky IAM policies and the crazy API Gateway incantations. It also follows the Flask decorator conventions!

I could have really used this a few months ago. I ended up writing a library of my own, but I'd much rather have used this, as it's supported by the AWS Python team.

This really lowers the barrier to entry to deploying Python-based API servers!

Re: Chalice: Python Serverless Microframework for AWS

#16
post #12

Earlier quoted context omitted.

What makes you say Lambda is more expensive than things like EC2? Obviously lambda is a hammer, not a swiss army knife - you shouldn't shoehorn it into your app just because it's the new tech on the block. But the use case isn't niche at all. We're using lambda for our service to ingest and process Hearthstone replays. An HTTP POST is sent to the API gateway, this triggers a lambda which parses a 0.5-2MB file, scrape…

"Let it be known that Lambda only supports python 2.7, not python 3, and that really frickin sucks. Get your shit together, Amazon." Node 4 support came, what, a month ago? It's pretty ridiculous.

I specifically don't understand the Python 3 situation. They support Python 2, it can't be that complicated to have a separate Python 3 runtime.

Re: Chalice: Python Serverless Microframework for AWS

#17

Earlier quoted context omitted.

It just means you don't have to worry at all about managing the servers, using thing like AWS Lambda which handle it for you. Generally these services will scale up and down for you as well.

That just worries me all the more. You basically get software engineers that wall themselves into their garden. It's like nodejs all over again...

That's been the trend in the software industry since about 2000. When I started then, the job description was just "software engineer", and you were expected to know networking, databases, low-level code, UI code, scripting, etc. Now you have "frontend software engineer", "backend software engineer", "full-stack software engineer" (which seems to mean web framework + database, which is a very different meaning from what "full stack" meant when I started, or what it means at big companies like Google), "AWS specialist", "web developer", "Android developer", "iOS developer", "SRE", "devops", "data scientist", "machine-learning researcher", "infrastructure engineer", etc.

It's actually a boon to entrepreneurial types who really do know the full stack inside and out. So many startups these days are "slap a web or mobile app in front of a manual process", so people who really do understand computation and all the things computers can do have less competition.

Re: Chalice: Python Serverless Microframework for AWS

#18
post #12

Earlier quoted context omitted.

What makes you say Lambda is more expensive than things like EC2? Obviously lambda is a hammer, not a swiss army knife - you shouldn't shoehorn it into your app just because it's the new tech on the block. But the use case isn't niche at all. We're using lambda for our service to ingest and process Hearthstone replays. An HTTP POST is sent to the API gateway, this triggers a lambda which parses a 0.5-2MB file, scrape…

"Let it be known that Lambda only supports python 2.7, not python 3, and that really frickin sucks. Get your shit together, Amazon." Node 4 support came, what, a month ago? It's pretty ridiculous.

There is no significant benefit to python 3 over python 2.

Re: Chalice: Python Serverless Microframework for AWS

#19
post #6

AWS Lambda is cool and all, but aren't people doing the math on this? Lambda seems like a really expensive way to deliver almost anything. Likewise, the AWS API Gateway is expensive, but at least provides some additional capabilities. Lambda seems like its profitable niche would be very small; limited computing environment, very high cost (relative to almost every other way to host an API), and having to learn a whol…

I've found Lambda to be really ridiculously fucking cheap. We moved image resizing onto it and saved thousands a month.

Don't compare the cost of Lambda per 100ms to the cost of a virtual machine per month since Lambda only charges as you use it. You'd have to have the CPU pegged at 100% usage to make that a fair comparison. Mind you even if you took the cost of Lambda per 100ms and multiplied that out for a monthly cost it's still about the same as an EC2 instance of the same capacity. (Eg. if I had a 1GB Lambda running for a total of 1 month compute time in the uswest2 region it'd cost $32).

Oh and the cost of API gateway is $3.50 per million requests and the bandwidth cost is completely negligible for us (we redirect to the resized image hosted on S3, fronted by cloudfront). We get 3 million image resizing requests a day. That's over 30 per second. It would take a lot of VMs to handle that (image resizing isn't trivial). Or we could just pay the whole $11.50.

I have to ask have you done the math? Lambda beats everything in cost except for some funky solutions using unreliable and less scalable lowendbox.com services.

Re: Chalice: Python Serverless Microframework for AWS

#20
post #6

AWS Lambda is cool and all, but aren't people doing the math on this? Lambda seems like a really expensive way to deliver almost anything. Likewise, the AWS API Gateway is expensive, but at least provides some additional capabilities. Lambda seems like its profitable niche would be very small; limited computing environment, very high cost (relative to almost every other way to host an API), and having to learn a whol…

[deleted]
Post reply on HN