GCP Professional Cloud Architect Practice Question
Your team is developing a Java microservice deployed on Cloud Run that must regularly scan several multi-million-object Cloud Storage buckets and write each object's metadata to Cloud Spanner. A developer suggests invoking the Cloud Storage JSON REST API with custom HTTP requests, manually retrieving OAuth 2.0 tokens from the metadata server, paging through nextPageToken values, and coding bespoke exponential-backoff retries. To align with Google Cloud API access best practices while minimizing future maintenance effort and risk, what should you recommend?
Reject the proposal and require using the official Cloud Storage Java client library, which provides automatic Application Default Credentials handling, pagination, and robust retry logic out of the box.
Approve the design but require embedding a long-lived service-account key in the container image instead of using the metadata server for authentication.
Approve the proposed design because direct REST calls avoid external dependencies and offer better scalability than client libraries.
Reject the proposal and migrate the workload to a Compute Engine VM that runs curl commands in a startup script to perform the same operations.
Using the Google Cloud Storage Java client library is the preferred approach because Google-maintained client libraries encapsulate many cross-cutting concerns for you. They automatically obtain and refresh Application Default Credentials when the service runs on Cloud Run, so there is no need to hand-roll token-management logic. The library also automatically handles paginated list results and applies proven, configurable retry and backoff policies for transient errors, greatly reducing custom code and the likelihood of bugs. Continuing with raw REST calls (options approving the proposal) would leave the team responsible for security-sensitive auth code and complex pagination and retry logic, increasing maintenance overhead. Replacing Cloud Run with a VM that executes curl commands does not address these concerns and adds operational burden. Therefore, insisting on the official Cloud Storage Java client library is the solution that best follows Google Cloud's guidance for accessing APIs via client libraries.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What are Application Default Credentials (ADC)?
Open an interactive chat with Bash
What is the benefit of using client libraries instead of REST API directly?
Open an interactive chat with Bash
Why is using a service account key in a container image not recommended?
Open an interactive chat with Bash
Why are Application Default Credentials important for Google Cloud APIs?
Open an interactive chat with Bash
What advantages do client libraries offer over REST API calls?
Open an interactive chat with Bash
Why is Cloud Run preferred over a VM for hosting microservices in this scenario?
Open an interactive chat with Bash
GCP Professional Cloud Architect
Managing implementation
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .