Orchestration in Google Cloud
1. Orchestration in Google Cloud
Google Cloud's Workflows platform can be used to implement the service orchestration pattern. Workflows is a fully managed orchestration platform which acts as the central orchestrator for the service orchestration pattern. You design and deploy workflows, which orchestrate Google Cloud services and API calls, to build stateful, automated processes. A workflow provides a central source-of-truth for the application flow. Each execution of a workflow is logged and is observable, which makes it easier to understand the current state of the workflow and troubleshoot any issues. A workflow can hold state, retry, poll, or wait for up to a year. This flexibility allows for creation of long-running business processes. Here's an example product ordering workflow. The first step in the workflow process is to check the Firestore inventory database for availability of the ordered products. If the items are available, they are locked. The workflow follows one of two paths, depending on whether any of the items are out of stock. The out of stock boolean condition is available throughout the workflow, and is also used at the end of the process. If every item in the order is available, the workflow calls a Cloud Run function to prepare the order confirmation message. If one or more items is out of stock, a Cloud Run service is triggered to request more inventory from the relevant suppliers. After the Cloud Run service is called, a "we're sorry" message is prepared for the customer. Next, the inventory and order details are updated in the Firestore databases. The customer is then sent an email indicating whether the order was successful or not. Finally, if one or more items is out of stock, a Slack message is posted to notify the sales rep. Each workflow execution, which handles a single transaction, is logged for troubleshooting or tracing. The workflow handles retries or exceptions thrown by APIs, improving the reliability of the entire process. Workflows is an excellent choice when you want to chain HTTP-based microservices into durable and stateful workflows. Workflows lets you implement long-running processes and maintain observability for each execution. Workflows is also a great choice for performing operations on a set of items or batch data. Robust error handling can guarantee that each item is processed correctly.2. Let's practice!
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.