Are AWs Lambdas serially reusable in Java

Viewed 28

Are AWS Lambdas serially reusable and thread-safe? In other words, can I use class fields to maintain state while the Lambda is running. I don't intend to re-use the state. Any field variables would be re-used and re-set at the next invocation. I just want to make sure that my Lambda won't be executed by multiple threads at the same time.

1 Answers

Yes, Lambda scales horizontally. It will spin up multiple instances but a particular Lambda is only in use by a single caller at a particular time. Multiple callers would get multiple Lambdas.

Related