QuestionQ172

Integrating applications with Google Cloud services

You are building an online chat application in which users can upload profile pictures. Uploaded profile pictures must meet content-policy requirements. You need to automatically detect and label inappropriate images as they are uploaded. In the future, this process must be expanded to include additional processing tasks, such as watermarking and image compression.

You want to simplify orchestration and minimize the operational overhead of the image-scanning and labeling steps, while ensuring that extra steps can be added or removed easily later. What should you do?

  • A Save user-uploaded images to a temporary Cloud Storage bucket. Implement code on the backend server to retrieve the image content and call the Vision API to process each new uploaded image.
  • B Save user-uploaded images to a Cloud Storage bucket. Configure a Cloud Function that is triggered when a new image is uploaded and calls one or more Cloud Run services. Create additional Cloud Run services that call the Vision API to process each new uploaded image.
  • C Save user-uploaded images to a Cloud Storage bucket. Configure a Cloud Function that is triggered when a new image is uploaded and publishes a message to a Pub/Sub topic. Deploy microservices in GKE that subscribe to the Pub/Sub topic and call the Vision API to process each new uploaded image.
  • D Save user-uploaded images to a Cloud Storage bucket. Create an Eventarc trigger that connects the bucket to the Workflows event receiver when a new image is uploaded. Create a workflow in Workflows with multiple Cloud Functions that call the Vision API to process each new uploaded image.
Explanation

Eventarc can route Cloud Storage object-upload events to a Workflows event receiver. Workflows is a fully managed, serverless orchestration platform that defines and executes ordered steps, and it can combine Cloud Functions with Google Cloud services such as Cloud Vision AI. Defining image scanning, labeling, watermarking, and compression as workflow steps provides low-operational-overhead orchestration and allows the processing sequence to be changed without operating servers or a GKE cluster.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!