Google Professional Cloud Developer exam dumps

Google Professional Cloud Developer practice question 393 of 481

Professional Cloud Developer. Professional level, Google Cloud. Free question with the correct answer and a full explanation.

Google Professional Cloud Developer Question 393

Select 2Google Cloud Platform

You are building a serverless application on Google Cloud that processes user-uploaded images and stores metadata about each image in a database. The images are stored in Cloud Storage, and the metadata is stored in Firestore. To ensure efficient integration between services, which of the following approaches should you use?

  1. A

    Use a Pub/Sub topic to trigger a Cloud Function that processes the image and writes metadata to Firestore.

  2. B

    Directly write the image metadata to Firestore from the client application after uploading the image to Cloud Storage.

  3. C

    Configure a Cloud Storage event to trigger a Cloud Function, which processes the image and writes metadata to Firestore.

  4. D

    Use Cloud Tasks to queue the metadata writing operation and process it asynchronously in the background.

  5. E

    Implement a custom API with Cloud Run to handle image processing and metadata storage in Firestore.

Show answer and explanation

Correct answers: A, C

Explanation

To integrate Cloud Storage and Firestore efficiently in a serverless environment, leveraging event-driven services like Cloud Functions triggered by either Pub/Sub or Cloud Storage events ensures scalability, reliability, and simplicity. These approaches align with best practices for decoupled architectures and reduce the operational overhead of managing custom APIs or task queues.

  • A. Correct.

    Correct: Using Pub/Sub with a Cloud Function is a recommended pattern for decoupling services in a serverless application. The Pub/Sub topic acts as an intermediary, ensuring reliable message delivery and triggering the processing logic in response to image uploads.

  • B. Incorrect.

    Incorrect: Writing directly to Firestore from the client application introduces potential security and consistency issues, as the client may not have the necessary permissions or the ability to ensure the data is processed correctly.

  • C. Correct.

    Correct: Using a Cloud Storage event to trigger a Cloud Function is a straightforward and efficient way to integrate Cloud Storage with Firestore. The event ensures that the function is triggered automatically whenever a new image is uploaded.

  • D. Incorrect.

    Incorrect: While Cloud Tasks is useful for background jobs, it is not the best fit for this use case, as the Cloud Storage event or Pub/Sub can handle triggers more natively and efficiently.

  • E. Incorrect.

    Incorrect: While Cloud Run is a viable option for building custom APIs, it adds unnecessary complexity compared to the simpler and event-driven nature of Cloud Functions for this use case.

Timed practice exam

Take a Google Professional Cloud Developer practice test under exam conditions

60 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam