Google Professional Cloud Developer Question 335
Select 3Google Cloud PlatformYou are deploying a new serverless application to Google Cloud Functions. The application needs to process messages from a Pub/Sub topic and must scale automatically based on the number of messages. Which of the following considerations are most important when configuring the deployment?
- A
Ensure the function is configured with the correct Pub/Sub topic as the trigger.
- B
Set a hard limit on the maximum number of instances to control costs.
- C
Use the appropriate runtime that supports the programming language of your application.
- D
Deploy the function to a specific region that is closest to your users.
- E
Manually configure the scaling settings to match the expected traffic.
Show answer and explanation
Correct answers: A, C, D
Explanation
When deploying a serverless application to Google Cloud Functions, key considerations include properly configuring triggers (such as a Pub/Sub topic), selecting the correct runtime for your application, and deploying to a region that minimizes latency. Cost control and scaling are important, but manual scaling configurations are unnecessary as Google Cloud Functions automatically handles scaling.
- A. Correct.
Correct. Configuring the function with the correct Pub/Sub topic as the trigger ensures that it processes the intended messages.
- B. Incorrect.
Incorrect. While managing costs is important, setting a hard limit on instances may prevent the function from scaling effectively to handle traffic spikes.
- C. Correct.
Correct. Choosing the appropriate runtime is critical for ensuring the function runs properly in the serverless environment.
- D. Correct.
Correct. Deploying to a region closest to your users reduces latency and improves the overall performance of your serverless application.
- E. Incorrect.
Incorrect. Scaling is automatically managed by Google Cloud Functions, so there is no need to manually configure scaling settings.