4 ms·
But there are already tools like https://github.com/Miserlou/django-zappa https://github.com/Miserlou/django-zappa https://aws.amazon.com/blogs/compute/buildi
by pmontra 11y ago
But there are already tools like
https://github.com/Miserlou/django-zappa https://github.com/Miserlou/django-zappa
https://aws.amazon.com/blogs/compute/building-enterprise-level-web-applications-on-aws-lambda-with-deep/ 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/getting-started.html 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.
- homero 11y agoWhat's the point of API Gateway? Looks like a proxy where you recreate your api and does nothing more.
- pmontra 11y agoI 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.
- inopinatus 11y agoThat'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.
- pmontra 11y agoI'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"?
- beat 11y agoAPI 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.
- homero 11y agoOffloading some calls into lambda does look cool