Google Professional Cloud Developer Question 235
Select 3Google Cloud PlatformYou are building a serverless application on Google Cloud and need to design it for high scalability and fault tolerance. Which of the following considerations should you prioritize when designing your application?
- A
Implement idempotent operations to handle retries safely.
- B
Design the application to use sticky sessions for user-specific data.
- C
Use Pub/Sub for decoupling components in the architecture.
- D
Store session state in memory to improve request performance.
- E
Leverage Cloud Functions with appropriate retry policies for asynchronous tasks.
Show answer and explanation
Correct answers: A, C, E
Explanation
Serverless architectures require careful design to ensure high scalability and fault tolerance. Key considerations include implementing idempotent operations to manage retries safely, using messaging systems like Pub/Sub to decouple components, and leveraging retry policies in Cloud Functions for asynchronous task execution. Avoid stateful designs such as sticky sessions or in-memory storage, as they contradict the principles of serverless computing.
- A. Correct.
Implementing idempotent operations ensures that retries in case of failures do not result in duplicate processing, which is crucial for fault-tolerant applications.
- B. Incorrect.
Sticky sessions tie user-specific data to a specific server, which reduces scalability and is not ideal for a serverless architecture.
- C. Correct.
Using Pub/Sub helps decouple components and improves scalability and fault tolerance by enabling asynchronous communication between services.
- D. Incorrect.
Storing session state in memory ties it to a specific instance, which is not suitable for scalable or serverless architectures where instances may be ephemeral.
- E. Correct.
Cloud Functions with appropriate retry policies handle asynchronous tasks reliably and ensure fault tolerance in case of temporary failures.