Introduction to This article starts with cloud computing and explains in detail the typical application scenarios of Serverless and some product introductions.

1. From cloud computing to serverless

Since the birth of the world's first general-purpose computer ENIAC (pictured left), the development of computer science and technology has never stopped moving forward. From 2003 to 2006, Google published these three very classic papers (pictured right), indicating the technical basis and future opportunities of HDFS (distributed file system), MapReduce (parallel computing) and HBase (distributed database) , Laid the foundation for the development direction of cloud computing.

image

So say from. The three classic papers from ENIAC to Google, the development of computer science and technology is constantly advancing. In the era of cloud computing, it can be said that the development of computer science and technology is advancing rapidly.

Cloud computing concept

For the definition of cloud computing, academic circles and industrial circles have different understandings. Review the development process of cloud computing:

1. In 2006, the CEO of Google put forward the concept of cloud computing for the first time at the Search Engine Conference; in the same year, Amazon sold its elastic computing capabilities as a cloud server, marking the official birth of this emerging business model of cloud computing;

2. In 2008, Microsoft released the cloud computing platform Windows Azure, trying to host and online technology and services;

3. In 2009, the "Berkeley Cloud Computing White Paper" was published, which clearly pointed out the definition of cloud computing: cloud computing includes application services on the Internet and the software and hardware facilities that provide these services in the data center.

After a clear definition, Berkeley put forward a vision for cloud computing, and also pointed out 10 problems faced by cloud computing, such as service availability, data loss, or data security and auditability.

image

2. Serverless concept

Serverless definition

Serverless translates to Chinese as serverless. The so-called serverless does not mean that there is no need to rely on resources such as servers. that developers no longer need to think too much about server issues, and can focus more on product code, and at the same time computing resources. Begin to appear as a service, instead of the concept of a server, Serverless is a complete process of constructing and managing a microservice architecture, allowing users to manage user application deployment at the service deployment level instead of the server deployment level. and the traditional architecture is that it is completely managed by a third party, triggered by events, exists in stateless (Stateless), temporarily stored (may only exist in the process of one call) in the computing container, Serverless deployment application Without involving more infrastructure construction, you can basically realize automatic construction, deployment and start-up of services.

Serverless architecture

image

On the left is the architecture of a relatively common Web application in the traditional sense, which is composed of elements such as client, server, and database.

In the past, when doing such projects, developers needed to do a lot of operations on the server side, such as purchasing servers, considering the number of purchases, broadband, operating system, deployment in which districts, environment, software, and so on. Later, humans need to monitor the health of this server in real time and constantly perceive it.

Under the serverless architecture, developers only need to care about our business code. During the entire development, launch, and maintenance process of the project, users do not need to pay attention to server-level maintenance, nor do they need to perform operation and maintenance for the peaks and valleys of traffic. This part of the investment of resources will be the responsibility of cloud vendors; at the same time, under the serverless architecture, users do not need to make additional expenditures for idle resources.

Serverless advantages

image

Serverless architecture has features such as zero server operation and maintenance and no computing costs when idle; its delivery mind can be reflected in leaving the complexity to cloud vendors and bringing convenience to more developers. In summary, the advantages of Serverless can be reflected in the following:

1) Cost reduction and efficiency

Cloud vendors provide users with server management and operation and maintenance work, and provide users with Baas services such as database and object storage, allowing users to focus more on their own business logic, improve R&D efficiency, and reduce project innovation At the same time, Serverless users do not have to worry more about their own server operation and maintenance, infrastructure operation and maintenance, let alone incurring additional expenses for this part, and do not need to bear more operation and maintenance costs, etc.; Serverless architecture Provides a relatively complete and comprehensive pay-as-you-go model, where users only need to pay according to the amount of resources they actually use; the serverless architecture has clear advantages at this level.

  • Reduce operation and maintenance costs
  • Reduce labor costs
  • Improve R&D efficiency
  • Reduce the innovation cycle
  • Pay as you go, reduce expenditure costs

2) Safe, convenient and reliable

Give more professional things to more professional people. The serverless architecture delegates more server operation and security-related things to cloud vendors to improve the overall security of the project on a large scale. At the same time, the serverless architecture is obviously better than others. The architecture is simpler, because more Baas services are provided by cloud vendors, and users will manage fewer components. This means that Serverless users can manage projects more easily and conveniently; at the same time, the Serverless architecture has flexibility. , That is, the ability to automatically scale, this ability allows the project to automatically expand when the traffic increases, and automatically scale when the traffic decreases, thereby ensuring the safety and stability of the entire business. The professional team guarantees safety and performance for users, which makes the Serverless architecture:

  • Lower security risk
  • Less resource overhead
  • In line with "green" computing thinking
  • More convenient management
  • Flexible scalability, more reliable service

Generally speaking, after hosting to cloud vendors, not only can the overall security and stability of the project be improved on a large scale, the serverless architecture is also significantly simpler than other architectures.

The challenge

Although the Serverless architecture has been around for many years, the time to truly enter the "first year" and achieve rapid development is actually very short; therefore, although the Serverless architecture has many advantages, it also faces some difficulties and challenges, including but not limited to serious cold start problems, development Incomplete tools, vendor lock-in, etc. However, the popularity of serverless architecture has continued to rise in recent years, and people have high hopes for it, and various manufacturers have also increased their investment. I believe that the current problems are temporary, and the serverless architecture will continue to evolve in a better and easier-to-use direction.

While the Serverless architecture provides users with a new programming paradigm, when users enjoy the first wave of technical dividends brought by Serverless, the shortcomings of Serverless are gradually exposed. For example, the problem of cold start of functions is now quite common. Serious and concerned issues. Because the serverless architecture has the ability to scale elastically, serverless service providers will increase or decrease instances according to the fluctuations in user service traffic. The schematic diagram is shown in the figure.

image

Take Alibaba Cloud Function Computing as an example. When the system receives the first event that triggers the function, it will start a container to run the code. If a new event is received at this time and the first container is still processing the previous event, the platform will start a second code instance to process the second event. This automatic zero-management level scaling of the Serverless architecture will continue Until there are enough code examples to handle all the workload. Of course, it is easier to trigger the cold start of the function not only under concurrent conditions, but also when the interval between the two triggers before and after the function exceeds the threshold of the instance release time, as shown in the following figure.

image

However, there is a problem involved here. When a new request or event arrives, in a broad sense, the following two situations may occur:

  1. There is an instance that is idle and can be reused directly: hot start.
  2. There is no idle instance that can be reused directly: cold start.

To execute a function locally, the environment is usually prepared, and only the method corresponding to the function needs to be executed each time it is executed, but this is not the case under the Serverless architecture. The difference between local and FaaS function calls is shown in the figure.

image

Three, typical application scenarios

Serverless architecture has been developed for several years since it was proposed, and there have been many best practices in many fields. CNCF has summarized some scenarios where Serverless architecture is suitable.

image

Real-time file processing

In scenarios such as video applications and social applications, the total amount of pictures, audio and video uploaded by users are often large and high in frequency, which has high requirements for the real-time and concurrency capabilities of the processing system. For example, for images uploaded by users, multiple functions can be used to process them separately, including image compression, format conversion, etc., to meet the needs of different scenarios.

image

Data ETL processing

Generally, to process big data, it is necessary to build a framework for related big data such as Hadoop or Spark, and at the same time, there must be a cluster to process the data. Through serverless technology, you only need to continuously store the obtained data in the object storage, and trigger the data splitting function through the object storage related trigger to split the related data or task, and then call the related processing function. After the processing is completed, Stored in cloud database.

The ability of function calculation to expand almost infinitely allows users to easily perform large-capacity data calculations. Using the serverless architecture, multiple mapper and reducer functions can be executed concurrently on the source data, and the work can be completed in a short time. The entire process can be simplified as shown in the following figure; compared with the traditional working method, the serverless architecture can avoid the idle waste of resources , Thereby saving costs.

image

Real-time data processing

Through the rich event sources supported by the Serverless architecture, and the event trigger mechanism, data can be processed in real time with a few lines of code and simple configuration, such as: decompressing object storage compressed packages, cleaning data in logs or databases , Customize consumption of MNS messages, etc.

image

Machine learning (AI inference prediction)

After the AI model is trained, the serverless architecture can be used when providing reasoning services to the outside world. By wrapping the data model in the calling function, the code can be run when the actual user request arrives. Compared with traditional reasoning and prediction, the advantage of this is that whether it is a function module or a back-end GPU server, as well as other related machine learning services that are connected, it can be paid according to the amount and automatically scaled to ensure performance while also ensuring The stability of the service.

image

Web application/mobile application backend

The serverless architecture is combined with other cloud products provided by cloud vendors. Developers can build elastically scalable mobile or web applications, easily create rich serverless backends, and these programs can run in multiple data centers with high availability. There is no need to perform any management work in terms of scalability and backup redundancy.

image

Audio and video transcoding

In scenarios such as video applications and social applications, users will upload some videos, and usually the uploaded videos will undergo some transcoding, including conversion to different definitions. After serverless technology and object storage related products are combined, object storage related triggers can be used, that is, the uploader uploads the video to the object storage, triggering the serverless architecture computing platform (FaaS platform) to process it, and then store it again after processing In the object storage, at this time, other users can choose the encoded video to play, and can also choose different definitions, as shown in the figure.

image

In summary, the typical application scenarios of the Serverless architecture are more determined by the characteristics of the Serverless architecture. Of course, as time goes on, the serverless architecture is also evolving, the characteristics will become more prominent, and the disadvantages will be made up for.

4. Serverless product introduction

Public cloud products

Since the concept of Serverless was proposed, it has gone from unknown to compelling for several years, and the Serverless architecture is also developing rapidly. In the Serverless architecture, computer services are usually provided by the Faas platform. AWS Lanmbda, Google Cloud Functions, Alibaba Cloud Function Computing, etc. are all representative industrialized products.

image

Faas platform listed by CNCF

Alibaba Cloud Serverless

The serverless architecture has high requirements for the underlying technical foundation. From the figure, it can be seen that the overall form of the serverless architecture of Alibaba Cloud is very complete, and it has been continuously improving on the road of self-construction and self-research. Alibaba Cloud's serverless products have been implemented within the Alibaba economy, and have been well represented in Taobao, Alipay, Xianyu, Feizhu, Dingding, and Yuque.

image

Functional computing is the most complete and feature-rich serverless product in the country. Developers will become a reality by moving to the cloud and one-click serverless. The above figure is some analysis of Alibaba Cloud Serverless from the product dimension, and the following figure expresses the typical business capabilities of Serverless from the function or architecture, the underlying infrastructure, and the computing level. For example, elastic scaling, load balancing, flow control, high-availability deployment, version grayscale failure recovery, etc. Like the container mirroring service at runtime, Alibaba Cloud launched last year, and then AWS, Tencent, etc. have also launched container mirroring one after another. The figure illustrates how Alibaba Cloud Serverless is gradually built to the upper level through the bottom layer, so that developers can use the whole process of Serverless more simply and conveniently.

image

Open source product

Not only in the industry, many vendors continue to work hard for the serverless architecture, there are also many excellent serverless projects in the open source field. Many excellent open source FaaS platforms including OpenWhisk, Fission, Knative and Kubeless have been recognized by CNCF.

image

Lecturer profile: Liu Yu (Jiang Yu) is a Ph.D candidate majoring in electronic information at National University of Defense Technology, Alibaba Cloud Serverless product manager, Alibaba Cloud Serverless cloud evangelist, and a distinguished lecturer of CIO Academy.

This article is organized from [ServerlessLive series live broadcast] September 22nd

Live playback link: https://developer.aliyun.com/learning/topic/serverless?

Copyright Statement: content of this article is contributed spontaneously by Alibaba Cloud real-name registered users, and the copyright belongs to the original author. The Alibaba Cloud Developer Community does not own its copyright and does not assume corresponding legal responsibilities. For specific rules, please refer to the "Alibaba Cloud Developer Community User Service Agreement" and the "Alibaba Cloud Developer Community Intellectual Property Protection Guidelines". If you find suspected plagiarism in this community, fill in the infringement complaint form to report it. Once verified, the community will immediately delete the suspected infringing content.

阿里云开发者
3.2k 声望6.3k 粉丝

阿里巴巴官方技术号,关于阿里巴巴经济体的技术创新、实战经验、技术人的成长心得均呈现于此。


引用和评论

0 条评论