0

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.

Peter Kronenberg
  • 878
  • 10
  • 32

1 Answers1

1

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.

stdunbar
  • 16,263
  • 11
  • 31
  • 53