News for hackers. Stuff that matters.
Re:Apex lets you build, deploy, and manage AWS Lambda functi... by pmontra on Friday May 20, 2016 @03:59AM (#11736187)
I didn't try it yet but it seems very useful.

I don't see a way to bind a function to a URL on the Amazon API gateway. Is it a missing feature or did I miss it in the documentation? I ask because setting up the URLs that map to functions is the most annoying task with Lambda and must be automated.

Re:Apex lets you build, deploy, and manage AWS Lambda functi... by inopinatus on Friday May 20, 2016 @04:43AM (#11736347)
It doesn't surprise me that people want to do that, but the design intention of Lambda is to invoke it asynchronously via writes to dynamodb, s3, sqs, IoT etc. I wouldn't make any assumption that someone building tools for Lambda is going to prioritise integration with the API Gateway and its somewhat alien synchronous behaviour.

The best fitted Lambda apps are going to have an event-sourced CQRS style, I think. AWS IoT is kinda the last piece of that puzzle to fall into place.

Re:Apex lets you build, deploy, and manage AWS Lambda functi... by southpolesteve on Friday May 20, 2016 @07:14AM (#11736933)
There is nothing wrong with using lambda to synchronously respond to user facing API requests. It actually works really well and I would highly recommend it. Were doing it in production at ~15 million calls/day.
Re:Apex lets you build, deploy, and manage AWS Lambda functi... by Touche on Friday May 20, 2016 @08:12AM (#11737124)
Isn't it expensive though?
Re:Apex lets you build, deploy, and manage AWS Lambda functi... by southpolesteve on Friday May 20, 2016 @10:30AM (#11738052)
That is the best part! It is cheaper! We had a node service that went from $2500/mo to $400/mo just by switching form Ec2 to Lambda. That is the most apples to apples comparison I can give you. Other services were split up or rewritten, but honestly my gut feeling tells me they are costing 10x-50x less.

IMO Autoscaling ec2 instances to daily traffic is not a trivial problem and you'll never get the granularity you can with Lambda

Re:Apex lets you build, deploy, and manage AWS Lambda functi... by leoalves on Friday May 20, 2016 @10:53AM (#11738262)
You are also saving in not having someone maintaining and making sure the server is always online. Even if it was the same price, not having to worry about the server is a big plus
Re:Apex lets you build, deploy, and manage AWS Lambda functi... by skrowl on Friday May 20, 2016 @09:04AM (#11737417)
Cheaper than standing up enough EC2 instances to do the same volume. That's the idea at least.
Re:Apex lets you build, deploy, and manage AWS Lambda functi... by zbjornson on Friday May 20, 2016 @11:47AM (#11738786)
Strictly looking at server uptime, yes, it's nearly 5x the cost of comparable t2 on-demand EC2 instances. That can be mitigated if you have spiky traffic where you'd need to turn on several EC2 instances for less than an hour but are stuck paying for the full hour, or if you can scale to zero for extended periods of time. You don't have the ability to serve concurrent requests from a single lambda worker, so if you're waiting for async IO then you're wasting money you wouldn't be wasting with EC2. -- For us lambda was prohibitively expensive at scale. I suspect a fair number of people reporting significant savings vs EC2 had over-provisioned instances.
Re:Apex lets you build, deploy, and manage AWS Lambda functi... by pmontra on Friday May 20, 2016 @06:05AM (#11736680)
But there are already tools like

https://github.com/Miserlou/django-zappa

https://aws.amazon.com/blogs/compute/building-enterprise-lev...

plus something else that was featured on HN recently and I can't find or remember.

Amazon itself has a tutorial about the integration of the API gateway with Lambda at http://docs.aws.amazon.com/apigateway/latest/developerguide/...

I saw an evangelist demoing it at an Amazon Summit a month ago. It's so time consuming and error prone that you don't want to do it manually more than once (not that he made any mistake).

So I won't say it's a corner case. Maybe it's too early to know what Lambda will grow into.

Re:Apex lets you build, deploy, and manage AWS Lambda functi... by homero on Friday May 20, 2016 @10:42AM (#11738151)
What's the point of API Gateway? Looks like a proxy where you recreate your api and does nothing more.
Re:Apex lets you build, deploy, and manage AWS Lambda functi... by beat on Friday May 20, 2016 @02:06PM (#11740078)
API Gateway does a number of things. It distributes endpoints via cloudfront, which is pretty awesome. It serves as a unified front end for a collection of back end microservices. It handles client cert authentication (important to us, but not to most people) and api keys for you, and a bunch of other neat stuff as well. And it offers a test harness where you can mock up data easily.

In theory, you could do the same thing with nginx and load balancers and multiple ec2 instances, but it'd be a lot more work. And I think the real magic is with integration with Lambda. That's a game-changer.

Re:Apex lets you build, deploy, and manage AWS Lambda functi... by homero on Saturday May 21, 2016 @02:45AM (#11743506)
Offloading some calls into lambda does look cool
Re:Apex lets you build, deploy, and manage AWS Lambda functi... by pmontra on Friday May 20, 2016 @11:33AM (#11738644)
I think I leant about it when I learnt about Lambda. In this context it's a convenient way to give a URL to a function, pass parameters to it and get back the result. You could build HN with the API gw, one Lambda function per each request and a db.
Re:Apex lets you build, deploy, and manage AWS Lambda functi... by inopinatus on Friday May 20, 2016 @06:05PM (#11741892)
That's exactly what I'm suggesting is an anti-pattern. Yes you can do that. Yes it's hardly surprising that AWS make it possible, since synchronous RESTful CRUD is such a popular integration approach and often the first one we learn.

But I'd advise you to design your LambdaNews service using an asynchronous event-driven model instead. You'll find it reduces complexity and makes for a snappier, more reliable client experience (e.g. no 429 throttling responses to handle). You'll also find that the supporting AWS services like Kinesis, Cognito, IoT, SNS, SQS, DynamoDB, S3 etc are much more in tune with that pattern.

The fact is that async platforms scale much better than anything that has to block and poll. It should hardly be surprising that at AWS's massive scale, it becomes a preferred service design pattern.

Pub/sub integration people have known this for decades, it is not news.

obdisclosure: I am ex-AWS but all the above is derived from public statements and documentation.

Re:Apex lets you build, deploy, and manage AWS Lambda functi... by pmontra on Saturday May 21, 2016 @12:10PM (#11745147)
I'm sincerely interested. The POST I use to submit this comment can be asynchronous, no problem (just do ajax). Same for votes and flags. The GET I use to get the page could be a real HTTP GET or diffs coming over a websocket (but I need a page to start with). I'm not sure how to implement that in the AWS ecosystem because I don't have much experience on it, but is it this what you mean with "asynchronous event-driven model"?
Re:Apex lets you build, deploy, and manage AWS Lambda functi... by Touche on Friday May 20, 2016 @06:32AM (#11736769)
> but the design intention of Lambda is to invoke it asynchronously via writes to dynamodb, s3, sqs, IoT etc.

I wish they (they being AWS or Apex or someone in this space) said this explicitly. Every time I've read about Lambda I've thought it's interesting but am not sure how/where to invoke it in production.

Re:Apex lets you build, deploy, and manage AWS Lambda functi... by dminor on Friday May 20, 2016 @11:21AM (#11738540)
Here's their documentation on the various ways to invoke a lambda function (including the API Gateway, contrary to what was stated above):

http://docs.aws.amazon.com/lambda/latest/dg/intro-core-compo...

Re:Apex lets you build, deploy, and manage AWS Lambda functi... by southpolesteve on Friday May 20, 2016 @07:05AM (#11736897)
I built a tool to do just that: https://github.com/bustlelabs/shep

It currently only supports node. If you are looking for just lambda, Apex is an awesome tool. But for us we needed end to end integration with API gateway and I wasn't happy with any of the other tools out there.

Re:Apex lets you build, deploy, and manage AWS Lambda functi... by lostcolony on Friday May 20, 2016 @09:52AM (#11737756)
Looks like they're not trying to do that yet. Serverless (serverless.com) has done that; Apex differentiates itself from Serverless in the OP.
Re:Apex lets you build, deploy, and manage AWS Lambda functi... by gfunk911 on Friday May 20, 2016 @01:13PM (#11739599)
Serverless (the framework) does this, FYI