Google Professional Cloud Developer Question 334
Select 2Google Cloud PlatformYou are deploying a serverless application using Cloud Run. The application processes incoming HTTP requests and requires the following: low latency, scalability to handle unpredictable traffic, and secure connectivity to a private Cloud SQL database. Which of the following steps should you take to meet these requirements?
- A
Enable HTTP/2 for the Cloud Run service to improve request latency.
- B
Configure the Cloud Run service with a VPC connector to access the private Cloud SQL instance.
- C
Set the concurrency setting for the Cloud Run service to 1 to ensure low latency for each request.
- D
Use a custom domain with HTTPS enabled to secure incoming requests.
- E
Configure the Cloud Run service to use the 'Always On' CPU allocation policy.
Show answer and explanation
Correct answers: B, D
Explanation
To deploy the application to a serverless environment like Cloud Run, you must ensure secure connectivity to private resources and follow best practices for scalability and security. Configuring a VPC connector enables access to the private Cloud SQL instance, while using a custom domain with HTTPS ensures secure communication for incoming requests. Other options, while useful in specific scenarios, are not directly required to meet the requirements of scalability, low latency, and secure database connectivity.
- A. Incorrect.
Enabling HTTP/2 can improve latency in some scenarios but is not directly required for secure connectivity to a private Cloud SQL instance or specifically to handle unpredictable traffic in this scenario.
- B. Correct.
Configuring a VPC connector is necessary for Cloud Run to access private resources, such as a Cloud SQL instance that is not publicly accessible.
- C. Incorrect.
Setting concurrency to 1 ensures each request gets a dedicated instance, but it can lead to higher costs and may not be necessary for low latency, as Cloud Run automatically scales to handle traffic.
- D. Correct.
Using a custom domain with HTTPS ensures secure and reliable communication with the application, which aligns with best practices for secure connectivity.
- E. Incorrect.
The 'Always On' CPU allocation policy is not needed for this scenario, as Cloud Run automatically scales based on traffic, and the default CPU allocation (only during request processing) is sufficient.