Complete the code to check if the key exists in Redis cache.
if redis_client.[1](key):
The exists command checks if a key is present in Redis.
Complete the code to retrieve a value from Redis cache.
value = redis_client.[1](key)The get command fetches the value stored at the given key.
Fix the error in the code to store data in Redis cache.
redis_client.[1](key, value)The set command stores a value at the given key in Redis.
Fill both blanks to implement cache-aside pattern: check cache and fetch from DB if missing.
if redis_client.[1](key): value = redis_client.[2](key) else: value = fetch_from_db(key)
First, exists checks if key is in cache. Then, get retrieves the value.
Fill all three blanks to complete cache-aside: fetch from DB, store in cache, then return value.
if not redis_client.[1](key): value = fetch_from_db(key) redis_client.[2](key, value) else: value = redis_client.[3](key)
Check if key exists. If not, fetch from DB and set in cache. Otherwise, get from cache.
