Skip to content

Are there issues with accessing data in APIGatewayRestResolver and lambda concurrency #1280

Closed Answered by heitorlessa
mcsloe asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @mcsloe - it's safe and allow me to clarify the Lambda concurrency model[1] for you.

A Lambda execution environment (container) can only process one request at a time. If a second request comes while the first hasn't completed yet, you now have a concurrency of 2.

This means you'll have two completely isolated memory shared space, process map, and disk.

When you try to access a request through the global object, you'll always get the request in read-only mode that belongs to that Lambda container handling that request - never shared.

What Lambda optimises for is to ensure an idle container doesn't get immediately thrown away - it may take a few minutes or seconds. This allows Lambda t…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mcsloe
Comment options

@heitorlessa
Comment options

Answer selected by mcsloe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants