×
Community Blog Serverless Workflow: A Fully Managed Serverless Cloud Service

Serverless Workflow: A Fully Managed Serverless Cloud Service

This blog will discuss the definition of Serverless Workflow, its feature and usage scenarios.

What is Serverless Workflow?

Serverless workflow is a fully managed cloud service that coordinates distributed tasks.
In Serverless workflow, you can orchestrate distributed tasks in sequence, in branches, or in parallel. Based on the defined steps, Serverless workflow reliably coordinates task executions, tracks the state transition of each task, and executes the user-defined retry logic when necessary to ensure the smooth completion of your flow. Serverless workflow provides the logging and auditing features to monitor flow executions, allowing you to diagnose and debug applications. Serverless workflow simplifies complex tasks such as task coordination, state management, and error handling required for application development and execution of business flows. In this way, developers can focus on business logic development.

The following figure illustrates how Serverless workflow coordinates distributed tasks, which can be functions, integrated cloud service APIs, and programs that run on virtual machines (VMs) or containers.

Why Use Serverless Workflow?

Serverless Workflow has the following features:

Service orchestration capabilities

Serverless workflow can separate flow logically from task execution and save you time in writing and orchestrating code. For example, after you call a face recognition function to detect the face in an image, the image is cropped based on the face position, and a message is sent to notify the user at last. Serverless workflow provides a serverless solution to reduce your orchestration and O&M costs.

Coordination of distributed components

Serverless workflow can coordinate applications that are developed in different languages, different architectures, and different networks. Serverless workflow serves as a coordinator when applications transit from Apsara Stack to the hybrid cloud (Apsara Stack and Alibaba Cloud) or Alibaba Cloud or evolve from a monolithic architecture to a microservices architecture.

Built-in error handling

By using built-in error retry and catch capabilities, you can automatically retry tasks that failed or timed out, respond differently to different types of errors, and define fallback logic.

Visual monitoring

Serverless workflow provides visual interfaces for you to define flows and view the execution status. The state includes input and output. This allows you to identify and troubleshoot problems.

Support for long-running flows

Serverless workflow can track the entire flow and allow long-time flow execution to ensure the completion of the flow. Some flows may take several hours, days, or even months, for example, O&M-related pipelines and email promotion flow.

Flow state management

Serverless workflow manages all states in a flow execution, including tracking its execution steps and the data transfer between steps. You do not need to manage the flow states yourself or build complex state management into tasks.

Where to Use Serverless Workflow?

Serverless workflow coordinates distributed applications and microservices to build complex, multi-step, stateful, and long-running flows.

Transactional flow orchestration

In complex scenarios that involve order management, such as e-commerce websites, hotel booking, and flight reservations, applications need to access multiple remote services and have high requirements for the operational semantics of transactions. In other words, all steps must succeed or fail without intermediate states. In applications with small traffic and centralized data storage, the atomicity, consistency, isolation, durability (ACID) properties of relational databases can guarantee that transactions are reliably processed. However, in large-traffic scenarios, distributed microservices are usually used for high availability and scalability. To guarantee reliable processing of multi-step transactions, the service providers usually need to introduce queues and persistent messages and display the flow status to the distributed architecture. This brings additional development and O&M costs. Serverless workflow ensures reliable processing of distributed transactions in complex flows and therefore helps users focus on their own business logic.

Multimedia file processing

Serverless workflow helps you orchestrate multiple tasks, such as transcoding, frame capture, face recognition, voice recognition, and review and upload of multimedia files, into a complete flow. You can use Function Compute to submit an Intelligent Media Management (IMM) task or a user-created processor to generate an output that meets your business requirements. Tasks that encounter errors and exceptions can be reliably retried, which significantly improves the multimedia task processing throughput.

Genetic data processing

Serverless workflow can orchestrate multiple distributed batch computing jobs in sequence or in parallel and reliably supports large-scale computing tasks that require long execution time and high concurrency. For example, in genetic data analysis, gene sequences are aligned, variation analysis is performed on all chromosomes in parallel, and finally, all chromosome data is aggregated to produce the results. Based on specified dependencies, Serverless workflow submits batch computing jobs with different CPU, memory, and bandwidth specifications to improve execution reliability and resource utilization and reduce costs.

Data pipelines

You can use the Serverless workflow to build highly available data pipelines. For example, measurement data from different data sources is collected into Log Service. A time-based trigger of Function Compute triggers Serverless workflow each hour. Serverless workflow uses Function Compute to process the measurement data of multiple shards in parallel and write the results back to Log Service. Then, all measurement data of the shards are aggregated and written into Table store. Finally, bills are generated for each user. Serverless workflow allows you to retry a failed step in a flow to reduce the failure probability. Serverless workflow supports dynamic parallel execution of tasks to achieve high scalability of data processing capabilities.

Automated O&M

Common challenges in automated O&M include cumbersome steps, varying lengths of execution time, low reliability of standalone scripts, complex dependencies, and inability to visualize the progress. The combination of Serverless workflow and Function Compute can perfectly handle these challenges. For example, during automated software deployment, you need to build Docker containers, upload container images, start and track nodes, track images on all nodes, and start the containers with new images. Logs generated by functions in each step are stored in Log Service so that you can query and use the logs. Compared with standalone O&M scripts, automated tools based on Serverless workflow provides higher availability, built-in error handling, and graphical progress.

Related Product

Serverless Workflow

Serverless Workflow is a fully managed serverless cloud service used to coordinate the execution of multiple distributed tasks. It is committed to simplifying tedious tasks, such as task coordination, state management, and error handling required to develop and run business processes. It enables you to focus on business logic development.

You can arrange distributed tasks in sequence, branch, and parallel. The service will reliably coordinate task execution according to the set sequence and track the state transition of each task. Then, it will execute custom retry logic (whenever necessary) to ensure the smooth completion of the workflow.

Related Blog

How TuSimple Built an Automated Data Processing Platform with Serverless Workflow

In April, Alibaba Cloud Serverless Workflow was officially launched for customers in Mainland China commercial use. It is a fully hosted serverless cloud service that is used to coordinate the execution of multiple distributed tasks. This product aims to simplify the tedious work of developing and running workflows, including task coordination, state management, and error handling. This allows users to focus on developing business logic.

Getting Started with Serverless: Serverless Architectures

According to the definition of serverless computing provided by the Cloud Native Computing Foundation (CNCF), serverless architectures are designed to fix issues by using the function as a service (FaaS) and backend as a service (BaaS). This definition clarifies the nature of serverless, but it causes confusion and arguments.

0 0 0
Share on

Alibaba Clouder

2,599 posts | 764 followers

You may also like

Alibaba Clouder

2,599 posts | 764 followers

Related Products