Question:
I'm using Redis as a caching database within my AWS Lambda functions, and I have a question regarding how Redis works under the hood when reusing the same Redis client instance across different Lambda invocations.
I use a single Redis client instance to avoid creating a new connection every time a Lambda function is invoked. My concern is about the potential side effects when multiple Lambda instances are invoked simultaneously.
multi/exec
commands.add
operation using the same Redis client instance.discard
, will the discard
command in Lambda 1 affect the Redis operations in Lambda 2?My Questions:
No, you don't need a separate Redis instance for each lambda invocation because: