Google Associate Cloud EngineerEnsuring successful operation of a cloud solutionHard
A media company stores large video files in a Cloud Storage bucket. They need to ensure that these files are automatically transcoded into multiple formats (e.g., MP4, WebM) whenever a new video is uploaded to the bucket. The transcoding process is computationally intensive and should be triggered by the upload event. Which combination of Google Cloud services should be used to achieve this?
- ACloud Pub/Sub and Compute Engine instances
- BCloud Functions and Cloud Storage triggers
- CCloud Dataflow and Cloud Storage notifications
- DCloud Run and Cloud Scheduler
Show answer & explanationAnswer & explanation
Correct answer: B. Cloud Functions and Cloud Storage triggers
Cloud Storage can directly trigger Cloud Functions upon object finalization (upload). A Cloud Function can then execute the computationally intensive transcoding process, leveraging its serverless nature to scale and run code in response to specific events.
Why the other options are wrong
- A. While Pub/Sub can notify Compute Engine, Cloud Functions with direct Cloud Storage triggers offer a more serverless and integrated approach for event-driven tasks, avoiding the overhead of managing Compute Engine instances for spasmodic workloads.
- C. Cloud Dataflow is for large-scale data processing pipelines, not typically for individual event-driven file transformations; Cloud Storage notifications could trigger it, but it's overkill for single-file transcoding.
- D. Cloud Run is great for containerized services, but Cloud Scheduler is for time-based triggers, not event-based triggers from Cloud Storage uploads. While Cloud Run could do the transcoding, the triggering mechanism is incorrect for this scenario.
Cloud Functions with Storage Triggers
A serverless compute service that runs code in response to events, including file uploads (object finalization) in Cloud Storage buckets.
- Event-driven execution model
- Serverless and scales automatically
- Supports various programming languages
- Ideal for lightweight, short-lived tasks triggered by cloud events
Memory trick: Event-Driven: 'When this happens, do that' – a cloud reaction system.