nerdexam
GoogleGoogle

PROFESSIONAL-CLOUD-DEVELOPER · Question #346

PROFESSIONAL-CLOUD-DEVELOPER Question #346: Real Exam Question with Answer & Explanation

The correct answer is C: 1. Use the Cloud SQL connector library for Python to connect to the Cloud SQL database through. The Cloud SQL connector library for Python, along with the Cloud SQL Auth Proxy, is the recommended way to connect securely to Cloud SQL from a Python application. This method handles authentication using IAM and allows your application to securely connect to the database without

Integrating Applications with Google Cloud Services

Question

You are using the latest stable version of Python 3 to develop an API that stores data in a Cloud SQL database. You need to perform CRUD operations on the production database securely and reliably with minimal effort. What should you do?

Options

  • A1. Use Cloud Composer to manage the connection to the Cloud SQL database from your Python
  • B1. Use the Cloud SQL API to connect to the Cloud SQL database from your Python application.
  • C1. Use the Cloud SQL connector library for Python to connect to the Cloud SQL database through
  • D1. Use the Cloud SQL emulator to connect to the Cloud SQL database from Cloud Shell

Explanation

The Cloud SQL connector library for Python, along with the Cloud SQL Auth Proxy, is the recommended way to connect securely to Cloud SQL from a Python application. This method handles authentication using IAM and allows your application to securely connect to the database without managing a password or setting up a static IP. Granting the cloudsql.instances.connect permission to the service account ensures that it has the necessary access to connect to the Cloud SQL instance. Using this approach provides a secure, reliable connection with minimal configuration and is preferred over options like the Cloud SQL API or Cloud Composer, which are not specifically designed for direct database connections in an application context.

Topics

#Cloud SQL#Database Connectivity#Python#Application Integration

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DEVELOPER PracticeBrowse All PROFESSIONAL-CLOUD-DEVELOPER Questions