Live data from Hacker News

Full Guide to Developing REST API’s with AWS API Gateway and AWS Lambda

blog.sourcerer.io

31–40 of 43 posts

Re: Full Guide to Developing REST API’s with AWS API Gateway and AWS Lambda

#31
post #10

Alternately: ``` from flask import Flask app=Flask() @app.route(‘/‘) def hi(): return "Hi!” ``` $ pip install zappa $ zappa init $ zappa deploy $ zappa certify IAM, SSL, API Gateway, Lambda, all taken care of. We did the work so you don't have to.

If using NodeJS there is a very similar package to zappa called Serverless https://serverless.com/ One thing I would improve with the authors article is he crammed a giant conditional statement on the http-method inside his one function. Serverless makes it easy to bundle a single function per HTTP method and even share common code between them. You can build out a whole application as a single npm package. Bonuses i…

Serverless Framework is also great for Python if you're not porting a WSGI application. Plug/Disclaimer: I'm the creator/maintainer of the defacto python dependency packaging plugin for serverless[0]

[0] https://github.com/UnitedIncome/serverless-python-requiremen...

Re: Full Guide to Developing REST API’s with AWS API Gateway and AWS Lambda

#32
post #8

Earlier quoted context omitted.

Ok given all these does it make sense to use AWS Lambda and AWS API Gateway? Does not sound like it will save you time.

Basically, caching allows you to cut your costs if you do it right. Also it is worth to note after 12 months API Gateway stops being free and caching may decrease amount on your bill. However, caching cluster is paid on hourly-basis and you must know if it will be worth to use it. Personally, I don't imagine to provide aaaaaaaaa.execute-api.eu-west-1.amazonaws.com/v1/transactions/XXXX/cancel as a API endpoint in the…

DNS records that point to AWS API endpoints... https://docs.aws.amazon.com/apigateway/latest/developerguide...

Re: Full Guide to Developing REST API’s with AWS API Gateway and AWS Lambda

#33
post #23

IME the AWS GUI is not useful for all that much in a meaningful context. Thus this post is pretty misleading to a new person getting involved in cloud; it doesn’t qualify as “full” in my mind. As a number of other comments have pointed out, there are packages that help with managing your infrastructure in code; which is critical outside of anything other than a play environment. Terraform, serverless, cloudformation,…

My experience... while Lambda is capable of hosting micro-services, any coding pipeline that emphasizes continuous integration (CI) will be better served with one, generic, monolithic Lambda function that dispatches to sub-modules behind the scenes.

However, this only scales up to a 50MB binary distributable.

Re: Full Guide to Developing REST API’s with AWS API Gateway and AWS Lambda

#34
post #23

IME the AWS GUI is not useful for all that much in a meaningful context. Thus this post is pretty misleading to a new person getting involved in cloud; it doesn’t qualify as “full” in my mind. As a number of other comments have pointed out, there are packages that help with managing your infrastructure in code; which is critical outside of anything other than a play environment. Terraform, serverless, cloudformation,…

My experience... while Lambda is capable of hosting micro-services, any coding pipeline that emphasizes continuous integration (CI) will be better served with one, generic, monolithic Lambda function that dispatches to sub-modules behind the scenes. However, this only scales up to a 50MB binary distributable.

Oh, interesting - can you share some information as to why you think the monolithic approach is best?

Re: Full Guide to Developing REST API’s with AWS API Gateway and AWS Lambda

#35
post #23

IME the AWS GUI is not useful for all that much in a meaningful context. Thus this post is pretty misleading to a new person getting involved in cloud; it doesn’t qualify as “full” in my mind. As a number of other comments have pointed out, there are packages that help with managing your infrastructure in code; which is critical outside of anything other than a play environment. Terraform, serverless, cloudformation,…

At least with the lambda UI, it's miles ahead of the google cloud functions UI. Both of those pale to the webtask implementation though.

Re: Full Guide to Developing REST API’s with AWS API Gateway and AWS Lambda

#36
post #34

Earlier quoted context omitted.

My experience... while Lambda is capable of hosting micro-services, any coding pipeline that emphasizes continuous integration (CI) will be better served with one, generic, monolithic Lambda function that dispatches to sub-modules behind the scenes. However, this only scales up to a 50MB binary distributable.

Oh, interesting - can you share some information as to why you think the monolithic approach is best?

Our use of Lambda runs in a VPC, so each new function requires a lot of manual network I/O and IAM configuration to trust the function.

A single monolithic JAR was the fastest way to close the feedback loop between idea, prototype, deploy, and validate.

Wouldn't say this is best. Just faster. Every retrospective is an opportunity to explore use of cloud formation, or some templated deployment model.

Re: Full Guide to Developing REST API’s with AWS API Gateway and AWS Lambda

#37
I wonder if I'm missing something. Given 10 minutes of load for pre warming, I was getting 95th percentile times of 1.6 seconds with a bare minimum node lambda hello world function. I threw 1,000 concurrent requests at it across 4 threads, with a 1,000 concurrent execution limit configuration on aws.

I was really excited about lambda, but that is flat out terrible performance for a lot of users. Is this not an issue for others? Why not?

Re: Full Guide to Developing REST API’s with AWS API Gateway and AWS Lambda

#38

Is there a use case for AWS API Gateway if one is not using Lambda ? Can it protect a web application against DDOS ? I am not convinced API gateway+ Lambda can substitute for a Web Application , atleast for J2EE apps. The Lambda "boot" time is way too high unless we resort to tricks to keep the lambda instance active. I find the extra $30 or similar is well spent on a a AWS Elastic Beanstalk with auto scaling. The pa…

After seriously kicking the tires on aws serverless, I still prefer running vm's as you do. Beanstalk is awesome, I like Heroku too. Other than the db, not too hard a move to beanstalk if it gets popular.

The cold starts are really bad for the 95th percentile latency, and you can't use a relational db with decent performance and throughput until aurora serverless rolls out.

Re: Full Guide to Developing REST API’s with AWS API Gateway and AWS Lambda

#39
post #22
post #10

Alternately: ``` from flask import Flask app=Flask() @app.route(‘/‘) def hi(): return "Hi!” ``` $ pip install zappa $ zappa init $ zappa deploy $ zappa certify IAM, SSL, API Gateway, Lambda, all taken care of. We did the work so you don't have to.

What is the group thought on running these containers that have access to (for example) a Postgres or Redis dB? Sure Zappa, keeps the “container-function-thing” alive so you can cache it as a global variable, but this is a jacket approach that I’m not clear enough on the consequences to use.

The most obvious limitation is the scale out concurrency model of lambda (serial requests within a container). This is great for simplicity but means you can’t have a connection pool.

Something like dynamo db is a better fit if it works for you, otherwise most people seem to be forced to run a few servers with pgbouncer

Re: Full Guide to Developing REST API’s with AWS API Gateway and AWS Lambda

#40

I wonder if I'm missing something. Given 10 minutes of load for pre warming, I was getting 95th percentile times of 1.6 seconds with a bare minimum node lambda hello world function. I threw 1,000 concurrent requests at it across 4 threads, with a 1,000 concurrent execution limit configuration on aws. I was really excited about lambda, but that is flat out terrible performance for a lot of users. Is this not an issue…

My results have been similar.
Post reply on HN