Google Cloud Professional Data Engineer — Question 21
Your weather app queries a database every 15 minutes to get the current temperature. The frontend is powered by Google App Engine and server millions of users. How should you design the frontend to respond to a database failure?
Answer options
- A. Issue a command to restart the database servers.
- B. Retry the query with exponential backoff, up to a cap of 15 minutes.
- C. Retry the query every second until it comes back online to minimize staleness of data.
- D. Reduce the query frequency to once every hour until the database comes back online.
Correct answer: B
Explanation
Option B is correct as it allows for a controlled and efficient retry mechanism that reduces load while waiting for the database to recover. Options A and D do not address the immediate need to retrieve data, and option C could lead to overwhelming the database if it remains down, making it less effective.