Google Professional Cloud Developer Question 34
Single answerGoogle Cloud PlatformYou are developing a web application hosted on Google Cloud that requires user session management. The application must handle user sessions to ensure scalability, support high availability, and minimize session loss in case of server failures. Which approach should you use to implement user session management effectively?
- A
Use Google Cloud Memorystore to store session data and retrieve it during user requests.
- B
Store session data in the instance memory of the Compute Engine VM handling the user’s request.
- C
Use Firebase Authentication with built-in session handling for user authentication and management.
- D
Leverage Google Cloud Storage to persist session data for durability and accessibility.
Show answer and explanation
Correct answer: A
Explanation
Using Google Cloud Memorystore for session management is the best approach because it is a managed service designed for low-latency storage and retrieval of data. It supports scalability and high availability, ensuring that user sessions are not lost during server failures or traffic spikes. Other options, like storing session data in VM memory or using Cloud Storage, do not meet the scalability and low-latency requirements of session management.
- A. Correct.
Google Cloud Memorystore is a managed in-memory data store that provides low-latency access to session data, which makes it ideal for scalable and highly available session management.
- B. Incorrect.
Storing session data in the instance memory of a VM leads to session stickiness, making it difficult to scale horizontally. Additionally, a server failure would result in session loss.
- C. Incorrect.
Firebase Authentication is primarily used for user authentication and does not natively manage user session data at scale for custom applications.
- D. Incorrect.
Google Cloud Storage is designed for large-scale object storage and is not optimized for low-latency access required for user session management.