The author | vanguard

Guests | Yang Haoran (no aversion)

What’s the next wave of clouds? Yang Haoran said “is Serverless”. As an Ali veteran, he joined Ali Cloud as early as 2010 and was deeply involved in the whole process of development and product iteration of Ali Cloud Flying Distributed system. Today, Yang Haoran is the head of Ali Cloud Serverless. What are the typical application scenarios of Serverless? What role can Serverless play in r&d effectiveness? What are the practices of Serverless within Ali? What are the trends? With these questions in mind, InfoQ recently interviewed Yang Haoran, head of Alibaba Cloud Serverless.

Serverless prospered

Serverless first appeared in 2012. Its appearance integrates all components of host management, operating system management, resource allocation, capacity expansion, and even application logic into services. Developers can more directly use most of the background capabilities as a capability interface. Change the use of capabilities during development to use of services by building or using a microservice or microfunction in response to events.

From concept talk to practice, Serverless begins to prosper.

According to O’Reilly’s Serverless Adoption Research report released in December 2019, 40% of respondents are in organizations that have adopted Serverless, and Serverless technology is used in a wide range of industries. Of particular concern is that more than 50% of respondents have adopted Serverless within one to three years, while 15% have started Serverless three years ago.

In Yang Haoran’s opinion, “Serverless prosperity” is inevitable:

  1. First of all, from the perspective of user demand, in the era of digital transformation, enterprises are facing huge competitive pressure and uncertainty. “The ability of time-to-market products is more important than ever”.

  2. Secondly, from the trend of technological development, cloud product system and its ecology are rapidly Serverles. Cloud service providers provide a large number of fully hosted and Serverless cloud services in storage, database, middleware, big data, AI and other fields. At the same time, the API economy has driven developers to provide a large number of API backend services in the form of Serverless.

Yang haoran said, “In this context, Serverless computing emerges as The Times require. It helps users build flexible, reliable and low-cost systems or applications by leveraging the capabilities of cloud Serverless product systems to shield the complexity of infrastructure.”

The advantage of Serverless is that it removes the homogenized and burdensome development and operation of server-based infrastructure from application development and allows users to focus on business innovation. Compared with the traditional development model, Serverless model builds applications based on a large number of mature cloud service capabilities, with fewer decision points for customers and lower implementation complexity.

Therefore, the Serverless architecture has great application potential for enterprises. Yang haoran said, “With the improvement of cloud products, the enhancement of product integration and integration capabilities, and the improvement of software delivery process automation capabilities, we believe that under the Serverless architecture, enterprise agility has the potential to be improved by 10 times.” In addition, Serverless helps users greatly improve resource utilization, reduce costs, and achieve better reliability.

But he also bluntly points out:

The biggest challenges for Serverless are the lack of maturity in the toolchain, product limitations, and application scenarios. However, these problems will improve as the product capability increases. In vertical fields, such as front-end full stack scenarios, application frameworks optimized for Serverless architecture have emerged to further reduce the user threshold and improve r&d efficiency.

Typical application scenarios of Serverless

1. Applets /Web/Mobile/API back-end services

In the small-program /Web/Mobile/API scenarios, the business logic is complex and changeable, and the iteration speed is high. In addition, the resource utilization rate of such online applications is usually less than 30%, especially for long-tail applications such as small-program, the resource utilization rate is less than 10%. Serverless computing’s o&M free and pay-on-demand features are very suitable for building small program /Web/Mobile/API back-end systems. By reserving computing resources and real-time automatic scaling, developers can quickly build online applications with stable delay and high frequency access.

According to Haoran Yang, inside Ali, Serverless is used to build back-end services, including Serverless For Frontends in the field of front-end full-stack, machine learning algorithm services, small program platform implementation and so on.

2. Perform a large-scale batch task

Typical offline batch task processing system, such as large-scale audio and video file transcoding service, contains a series of functions such as computing resource management, task priority scheduling, task scheduling, reliable task execution, and task data visualization. If the construction starts from the machine or container level, users usually use message queues to persist task information and allocate computing resources, use container scheduling systems such as K8s to achieve resource scaling and fault tolerance, and automatically build or integrate monitoring and alarm systems.

If a task involves multiple steps, workflow services also need to be integrated for reliable step execution, whereas with the Serverless computing platform, users only need to focus on implementing task processing logic. At the same time, the extreme elasticity of Serverless computing can well meet the demands of unexpected tasks on computing power.

3. Online application and offline data processing based on event-driven architecture

Serverless computing service is widely integrated with various types of cloud services through event-driven mode. Users do not need to manage servers and other infrastructure and write “glue code” to integrate multiple services, so it is easy to build applications with loosely coupled and distributed event-driven architecture.

Taking Ali Cloud function computing as an example, users can quickly realize API back-end services through the integration of API gateway and function computing. Through the event integration of object storage and function calculation, functions can respond to events such as object creation and deletion in real time, and realize large-scale data processing centered on object storage. Through the event integration of message middleware and function calculation, users can quickly process massive messages. Through the integration with Aliyun EventBridge, all events can be quickly and conveniently processed by functions, whether it is the cloud service of one party, the SaaS service of three parties, or the system built by users.

4. Operation and maintenance automation

With timed triggers, users can quickly implement timed tasks with functions without having to manage the underlying servers that perform the tasks. By using cloud monitoring triggers, users can receive O&M events of IaaS services, such as ECS restart or outage and OSS object storage flow control, and automatically trigger functions for processing.

Serverless changes and innovations in R&D efficiency

Serverless offers users a new way to build applications. With a number of mature cloud services, users can build resilient and highly available applications like building blocks. For example, with the help of the integration of object storage and function computing, users can quickly realize the parallel processing of large-scale data without the need to build and operate the underlying computing and storage platform from scratch, thus greatly reducing the mental burden of researchers and improving efficiency.

In addition, Serverless Computing supports the infrastructure-as-code model well, providing a host of tools that automate every step of the software delivery pipeline, enabling developers to focus on more innovative work and improve r&d effectiveness.

Serverless practices within Ali

According to Yang Haoran, Ali has widely adopted Serverless architecture in front-end full stack, large-scale batch task execution, machine learning algorithm services, operation and maintenance automation and other fields, with obvious benefits in cost and r&d efficiency.

Front-end full stack domain

Ali proposed the SFF (Serverless For Frontends) architecture. SFF can take advantage of Serverless’s flexible capacity expansion to reduce the focus of r&d on infrastructure and operations. For the front-end developers, they only need to write a few functions to implement the back-end business logic and bring the business online quickly.

Take Taobao.com for example, taobao.com’s content shopping guide channel uses SFF structure to support the Double Eleven Promotion smoothly. Previously, there are two problems that guide shopping business faces:

First, the shopping guide business is updated and iterated frequently, which requires the cooperation of the students at the front and back end after each update, which brings great communication costs. Second, the shopping guide channel carries the traffic of the core link of Taobao business, so a large amount of computing resources should be reserved in advance before each promotion, which will bring great operation and maintenance costs.

After Taobao uses SFF architecture, the channel’s business logic is undertaken by functions, and each business corresponds to an independent entry function. The function calls the lower level middleware to obtain data, calculates business data through data assembly and tailoring, and returns it to the front end. Serverless elastic O&M features enable front-end engineers to independently take charge of the entire service link without the involvement of back-end engineers, reducing the cost of front-end and back-end joint commissioning and eliminating the o&M cost.

It is reported that after using SFF structure, Taobao can save 50% project manpower and improve r&d efficiency by 40%.

Yang Haoran said, “Alibaba Economic Front-end Committee is also actively exploring new framework and tools for Serverless optimization, enhanced Nodejs runtime, etc., to promote the implementation of more business scenarios. Serverless is definitely going to be a hot spot in the front-end full-stack space this year.”

In addition to front-end full-stack field, Ali also uses Serverless architecture to realize computationally intensive applications with obvious load peaks and valleys, including audio and video processing, front-end automated testing based on Headless Chrome, etc. “The resource consumption reaches tens of thousands of core hours per day”.

In addition, Ali Cloud database Autonomous service (DAS) to complete the index analysis and prediction of hundreds of thousands of database instances, the flexibility and reliability of resources have high requirements. It uses function calculations to run both online and offline machine learning algorithm applications and can easily handle traffic peaks. Developers focus on the design, implementation and tuning of the algorithm, greatly improving the iteration speed of the product.

In view of the development of Serverless, Yang Haoran believes that Serverless has been developing rapidly in recent years, showing more and more influence. At the same time, the mainstream cloud service providers are constantly enriching the cloud product system, improving better development tools, more efficient application delivery pipeline, better visibility and more delicate product integration.

Future development of Serverless

When talking about the development trend of Serverless, Yang Haoran mentioned four aspects:

1. Serverless will be everywhere

Any sufficiently complex technical solution will be implemented as a fully managed, Serverless back-end service. Serverless will be the most important part of any platform product or organization that uses API as the way of function disclosure, such as Dingding, wechat, Didi, etc.

2. Serverless will be more closely integrated with the container ecosystem

Container is a revolutionary innovation in application portability and delivery process agility, which is an important change in modern application construction and delivery. Today, developers around the world are used to containers as a means of application delivery and distribution. There is already a whole chain of application delivery tools around the container. In the future, container image will also become the distribution method of more Serverless applications such as function computing. The combination of container’s huge tool ecology and Serverless free operation and maintenance and extreme flexibility will bring users a brand new experience.

3. Serverless will connect everything in the cloud and its ecosystem in an event-driven way

Whether it’s a user’s own app or a partner’s service; Whether on-premise environment or public cloud, all events can be handled in a Serverless manner. Cloud services and their ecosystem will be more closely connected and become the building blocks for users to build resilient and highly available applications.

4. Serverless computing will continue to improve computing density to achieve the best performance/power ratio and performance/price ratio

On the one hand, Serverless computing platform requires the highest security and minimum resource overhead, so it must have both. On the other hand, preserving compatibility with the way the program is executed, such as supporting arbitrary binaries, makes a solution for a language-specific VM impractical. Therefore, AWS Firecracker, Google gVisor and other new lightweight virtualization technologies emerge at the right moment. Taking AWS Firecracker as an example, it can realize the startup speed of 100 milliseconds and minimum memory overhead by cutting the device model and optimizing the kernel loading process.

Support for heterogeneous hardware is another important direction to achieve optimal performance/power ratio and performance/price ratio. Over time, X86 processors have become increasingly difficult to improve. On the other hand, processors based on THE ARCHITECTURE of GPU, FPGA, TPU (Tensor Processing Units) have more advantages in computing efficiency in scenarios requiring high computational power, such as AI. As heterogeneous hardware virtualization, resource pooling, heterogeneous resource scheduling, and application frameworks mature, the computing power of heterogeneous hardware can be released in Serverless mode, greatly reducing the user threshold.