databaseamazon-web-servicesaws-lambdaredis

Redis Instance Reuse in AWS Lambda


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.

Scenario:

My Questions:

  1. Does reusing the same Redis client instance across different Lambda invocations cause any interference between the operations of those invocations as they share the same instance connection?
  2. Should I create a new Redis client instance for each Lambda invocation to avoid potential conflicts?

Solution

  • No, you don't need a separate Redis instance for each lambada invocation because,