Google Cloud Professional Cloud Developer — Question 348
You are building an application that will store frequently accessed data in a Memorystore for Redis Cluster instance. You would like to make the application resilient to network issues. You need to ensure that the application handles client disconnections from a Redis instance gracefully to minimize disruption and ensure stability of the application. What should you do?
Answer options
- A. Immediately terminate the application instance upon detecting a Redis disconnection to force a restart, and wait for clients to reconnect to the cache as soon as the application becomes available.
- B. Configure the Redis client to reconnect after a fixed delay of 60 seconds.
- C. Use Memorystore’s automatic failover mechanisms to make the Redis cache available in a secondary zone.
- D. Implement exponential backoff with a jitter when reconnecting after a disconnection. Configure client-side caching to serve data during brief outages.
Correct answer: D
Explanation
The correct answer is D because implementing exponential backoff with jitter allows for a more efficient and stable reconnection strategy during network disruptions, while client-side caching ensures data availability during outages. Option A is incorrect as abruptly terminating the application can cause more issues than it solves. Option B lacks a robust strategy for managing reconnections, and option C, while useful, does not directly address handling client disconnections.