Live data from Hacker News

Improved VPC Networking for AWS Lambda

aws.amazon.com

21–30 of 100 posts

Re: Improved VPC Networking for AWS Lambda

#21
post #17

Earlier quoted context omitted.

*It allows devs to create those apps _within a VPC_. You could always have fast startup with Lambda + database outside the VPC.

Also, wasn't Aurora Serverless created because of that problem?

Aurora Serverless also handles connections. The problem of having a burst of 1000 concurrent invocations accessing your databases still exists even with VPC access

Re: Improved VPC Networking for AWS Lambda

#23
post #3

This is huge for Lambda. It allows devs to create “serverless” apps [1], with relational databases, without 10+ second cold-start times. In the article, they measure it as 988ms. I have tried building an API using API Gateway Lambda, but had to choose between using DynamoDB to store data (no-SQL, so challenging to query) or suffering unacceptably long response times whenever a request happens to cause a cold-start. T…

*It allows devs to create those apps _within a VPC_. You could always have fast startup with Lambda + database outside the VPC.

You raise a fair point, this was possible, although it seems safe to say it would be a compromise on security.

I think it’s best not to expose the DB to outside connections in general, although it is still possible [1] when using RDS instances.

I think this is different for things like DynamoDB because, instead of a standard SQL-like db “connection”, they use AWS role-based auth for each request.

Of course, one could always configure some type of proxy service between the lambda and the DB... but that seems antithetical to going “serverless” in the first place.

[1] https://stackoverflow.com/questions/45227397/publicly-access...

Edit: I thought it was not possible to expose an RDS instance outside of a VPC, but I was wrong (you can place it in a public subnet, linked in [1]).

Re: Improved VPC Networking for AWS Lambda

#24
post #17

Earlier quoted context omitted.

*It allows devs to create those apps _within a VPC_. You could always have fast startup with Lambda + database outside the VPC.

Also, wasn't Aurora Serverless created because of that problem?

I think Aurora Serverless has even worse [1] cold-start times (for the DB itself), and it was intended as more of a price-optimization than a performance boost.

[1] https://forums.aws.amazon.com/thread.jspa?threadID=288043

Re: Improved VPC Networking for AWS Lambda

#25

Iconoclast view ahead (change my mind please): AWS does tons of stuff around VPCs....I feel like they really want me to use them (or their customers really want to use them), but I just don't see why. I just run RDS on the internet. I don't have to muck with the complexity or cost of NATs or peering or Lambda slow start or any other weird networking issues. I know it's "public", but that seems irrelevant in the era o…

Defense in depth. Not having public routes to your database adds another layer of protection. You should have multiple, and they should be redundant.

Re: Improved VPC Networking for AWS Lambda

#26
post #22

This solves one part of the cold start problem. Starting the container and loading the image on to it is still going to cause some latency.

Solves might be strong, but it removes a big portion of the cold start latency that was difficult to optimize for and out of the control of developers. Creating minimal images isn't difficult for a number of environments (e.g. webpacking your node.js lambdas) and barring necessarily large images (think pandas on Lambda) this puts a lot of control for the cold start p99 back in the hands of customers.

Overall, definitely a big win!

Re: Improved VPC Networking for AWS Lambda

#27
post #22

This solves one part of the cold start problem. Starting the container and loading the image on to it is still going to cause some latency.

Which can be mitigated by invoking your own Lambda functions once every minute or 5 minutes. Usually does not blow the budget.

Re: Improved VPC Networking for AWS Lambda

#28
post #22

This solves one part of the cold start problem. Starting the container and loading the image on to it is still going to cause some latency.

Which can be mitigated by invoking your own Lambda functions once every minute or 5 minutes. Usually does not blow the budget.

Warming functions in the previous VPC architecture was always a questionable practice. You had no guarantee that your environments would be warm across all subnets or which subnets would handle incoming requests. Beyond that, what happens to requests which you receive when the function is being warmed? You still incur cold starts.

There has never been a guarantee of environment reuse. Any architecture which isn't capable of incurring cold starts is not a good fit for serverless.

Re: Improved VPC Networking for AWS Lambda

#29
post #22

This solves one part of the cold start problem. Starting the container and loading the image on to it is still going to cause some latency.

I found it a bit strange that they sold Lambda as THE new way to do API development.

You can connect API-Gateway with other services via Velocity templates, which don't have cold starts.

AppSync also doesn't suffer from cold starts.

Both are also serverless services.

Lambda is good if the other solutions are missing something, so you can drop it in quickly, but I wouldn't use it as the go to services for that...

Re: Improved VPC Networking for AWS Lambda

#30
post #11

Earlier quoted context omitted.

So making the actual listening port for a database server "public" is generally a bad idea as that is another attack surface of code that honestly is hardly ever made public... but if when you say "public" you mean you are using security groups (which are super trivial to use and easy to understand) to define which other AWS devices can access the port, then yeah: I have never seen any reason why this entire feature…

My theory is that a bunch of entrenched network engineers just really like subnets and IPv4 and NAT and don't realize how mostly unnecessary it is in an era of cloud infrastructure and IPv6. My grandchildren are still going to be NAT'ing.

I think it is easy to have dev, qa and prod VPCs. Without VPC these separate infrastructure groups might be harder to split out. I usually reference security groups instead of subnets in security groups, avoiding referencing IP ranges (v4 or v6) entirely.
Post reply on HN