Google Cloud Professional Cloud Developer — Question 323
Your company manages an application that captures stock data in an internal database. You need to create an API that provides real-time stock data to users. You want to return stock data to users as quickly as possible, and you want your solution to be highly scalable. What should you do?
Answer options
- A. Create a BigQuery dataset and table to act as the internal database. Query the table when user requests are received.
- B. Create a Memorystore for Redis instance to store all stock market data. Query this database when user requests are received.
- C. Create a Bigtable instance. Query the table when user requests are received. Configure a Pub/Sub topic to queue user requests that your API will respond to.
- D. Create a Memorystore for Redis instance, and use this database to store the most accessed stock data. Query this instance first when user requests are received, and fall back to the internal database.
Correct answer: D
Explanation
The correct answer is D because using Memorystore for Redis allows for quick access to frequently requested stock data, enhancing performance. This approach minimizes latency by serving from Redis first and only querying the internal database if the data isn't available, which is more efficient than querying a slower database for every request. The other options either do not prioritize speed or scalability as effectively as option D.