Google Professional Cloud Developer Question 420
Single answerGoogle Cloud PlatformYou are building a serverless application on Google Cloud to process customer orders. When an order is placed, the application must trigger a sequence of tasks: validating the order, reserving inventory, and notifying the customer. Each task depends on the successful completion of the previous one. Additionally, you need to ensure the process can handle retries for failed tasks and maintain an audit trail of all steps. Which Google Cloud service should you use to orchestrate this workflow while meeting these requirements?
- A
Workflows
- B
Eventarc
- C
Cloud Tasks
- D
Cloud Scheduler
Show answer and explanation
Correct answer: A
Explanation
Workflows is the most suitable service for orchestrating dependent tasks in a serverless application. It allows you to define a sequence of steps, manage retries for failed steps, and maintain an audit trail. The other options (Eventarc, Cloud Tasks, and Cloud Scheduler) are more specialized for specific use cases like event-driven architectures, task queuing, or job scheduling, but do not provide the comprehensive orchestration capabilities required in this scenario.
- A. Correct.
Workflows is the correct choice for orchestrating complex, sequential tasks with dependencies between them. It supports retries, error handling, and an audit trail, making it suitable for this scenario.
- B. Incorrect.
Eventarc is used for event-driven architectures but does not provide the ability to orchestrate sequential tasks with dependencies. It is better suited for reacting to events rather than managing workflows.
- C. Incorrect.
Cloud Tasks is useful for managing asynchronous task queues, but it does not provide orchestration capabilities required for a sequential workflow with dependencies.
- D. Incorrect.
Cloud Scheduler is used to schedule jobs at specific times or intervals but does not support orchestrating dependent tasks in a workflow.