PROFESSIONAL-CLOUD-DEVELOPER · Question #346
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 wit
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 provides secure, production-ready connections to Cloud SQL with minimal effort. It handles IAM-based authentication, automatic certificate management for encrypted connections, and integrates with popular Python ORMs (like SQLAlchemy). T
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
- A
- Use Cloud Composer to manage the connection to the Cloud SQL database from your Python
- B
- Use the Cloud SQL API to connect to the Cloud SQL database from your Python application.
- C
- Use the Cloud SQL connector library for Python to connect to the Cloud SQL database through
- D
- Use the Cloud SQL emulator to connect to the Cloud SQL database from Cloud Shell
How the community answered
(52 responses)- A4% (2)
- B10% (5)
- C85% (44)
- D2% (1)
Explanation
The Cloud SQL Connector library for Python provides secure, production-ready connections to Cloud SQL with minimal effort. It handles IAM-based authentication, automatic certificate management for encrypted connections, and integrates with popular Python ORMs (like SQLAlchemy). This satisfies the 'secure and reliable with minimal effort' requirement. Option A (Cloud Composer) is a workflow orchestration service built on Apache Airflow - it is not a database connection library for CRUD operations. Option B (Cloud SQL API) is a REST management API for administering Cloud SQL instances (creating, deleting, configuring), not for executing SQL queries from an application. Option D (Cloud SQL emulator) is a local development/testing tool and is not appropriate for production database connections.
Topics
Community Discussion
No community discussion yet for this question.