Getting started from scratch Serverless | Detailed article Serverless technology selection

Posted Jun 15, 20208 min read

6.12Header.png

Author | Li Guoqiang Senior Product Expert of Alibaba Cloud

This article is compiled from "Serverless Technology Open Course". Follow the "Serverless" public account and reply to "Getting Started" to get the PPT of Serverless series articles.

Today, in the large field of Serverless, not only the product form and application type of function calculation, but also for different user groups and usage habits, each has its own applicable Serverless products. For example, function-oriented function calculation, application-oriented Serverless application engine, and container-oriented Serverless Kubernetes, users can choose which Serverless products to use according to their own usage habits, usage scenarios or application types. The following article will introduce to you what serverless products Alibaba Cloud has for you to choose from.

Serverless products and layering

As we all know, the first to propose Serverless is AWS, and its flagship product in the field of Serverless is function compute. Alibaba Cloud also has functional computing products to help users build Serverless functions. However, Serverless is not just a function, as shown in the following figure. In fact, users will expect to enjoy the benefits of Serverless at the application and container levels, including pay-as-you-go, extreme flexibility, etc., which is more in line with users' original usage habits.

Slide 2.JPG

In the above picture, you can see that Alibaba Cloud has launched corresponding Serverless products for functions, applications and containers, and users can choose different products for their own usage scenarios.

Function calculation

1. Introduction to Function Calculation

Slide 3.JPG

The figure above shows how to use the function calculation. From the user's perspective, all he needs to do is encode, and then upload the code to the function calculation. No charges will be incurred at this time, but only when called. The calling method can be the API/SDK provided by the product, or through some event sources, such as Alibaba Cloud OSS events. For example, a user uploads a file to a bucket in the OSS, and hopes that the file will be processed automatically; for example, uploading a zip package, hoping to be able to automatically decompress to another bucket, this is a typical function scenario.

In addition, function calculation can provide very good flexibility. The final cost is billed according to the length of time and the number of memory. If the amount of calls is small, there will be very little cost. And it is also very rich in language, commonly used nodejs, php, python, java are directly supported. At the same time provide a custom operating environment, can support any executable language.

2. Typical scene of function calculation

Slide 4.JPG

In terms of usage scenarios, there are three main categories:

  • Web application:It can be written in various languages. This kind of program can be newly written using the Serverless framework, or it can be an existing application. Such as applet backend, or API backend application published to API market, etc.;
  • Applications with strong flexibility in computing power:such as AI reasoning, audio and video processing, document conversion, etc.;
  • Event-driven applications:such as scenarios driven by other Alibaba Cloud products, Web Hooks, scheduled tasks, etc., function calculation has been communicated with many products, such as object storage, table storage, timers, CDN, log service, cloud Monitoring, etc., can assemble some business logic very quickly.

3. Function computing core competitiveness

Slide 5.JPG

One of the greatest value of function calculation to customers is to enable users to focus only on their own business logic development without any need to manage operation and maintenance, such as computing resources and network settings. Provides vm-level isolation in terms of isolation to ensure user data security at runtime, runtime security, etc.; in terms of availability, it provides a high availability architecture of 3az by default, ensuring that customers default to high availability best practice architecture; in terms of flexibility It can achieve millisecond-level elastic efficiency to meet the sudden traffic impact of customers; it is also very flexible in terms of billing, and it is really charged according to the user's request. It also supports a pre-paid model that is more friendly to long run applications.

Serverless application engine

  1. SAE Overview

Slide 6.JPG

SAE is the industry's first application-oriented Serverless Paas platform. This product helps users apply inventory to the cloud without any modification from an application-oriented perspective. At the resource layer, users no longer need to manage and operate machines and clusters themselves. They only need to pay attention to the specifications and number of instances that their applications need to use. They no longer need to care about whether the underlying layer is a virtual machine or a container.

SAE provides computing resources, flexibility, isolation and other capabilities from the resource level, so that users only need to focus on their own applications. At the application layer, SAE provides capabilities such as monitoring, logging, and microservice governance to help users address application observability and governance needs. At the same time, it provides network configuration and flow control capabilities, and provides good integration with CICD. Users can use existing CICD to deploy to SAE, such as jenkins, cloud effects, etc., which can be said to cover the complete scenario of cloud application.

  1. SAE typical scenarios

Slide 7.JPG

There are several typical usage scenarios for SAE. One is the cloud storage of stock services, especially microservices and java applications. It also supports monolithic applications in other languages. They can run on Alibaba Cloud through the SAE platform, and there is no need to do it. Any code modification. In terms of industry, SAE is particularly suitable for online businesses with relatively large traffic fluctuations, such as e-commerce promotion and online education. In addition, as an application platform, SAE can also be integrated by upper-level industry Saas, helping users build industry Saas faster.

  1. SAE features

Slide 8.JPG

Through the introduction of the above scenario, we can see that in addition to the extreme flexibility and operation-free maintenance brought by the serverless experience itself, SAE focuses on providing the user with a full stack capability at the application layer, including enhanced support for microservices. As well as integrating capabilities related to applications, including configuration, monitoring, logging, and flow control. Coupled with the user's zero code changes, it is a very good choice for enterprise online business to go to the cloud smoothly.

Serverless Kubernetes

  1. Overview of ASK

Slide 9.JPG

Another Serverless product provided by Alibaba Cloud is Serverless K8s. But how can K8s still be serverless? This requires an understanding of the evolution of the technical architecture.

At the earliest time, everyone deployed the Docker image in the virtual machine. Users need to purchase ECS, then deploy the image, and finally some network configuration, such as SLB, EIP, etc. In this process, users need to complete the deployment actions themselves, expansion needs to repeat the above actions themselves, or build an automated script by themselves, relatively speaking, the cost and stability are relatively low.

After that, we have K8s to help you solve the problem of container layout. This standardized approach has greatly improved everyone's productivity. The user arranges and deploys by using standard K8s such as deployment and service. However, the operation, maintenance and management of K8s are still relatively complicated, and the skill requirements are relatively high. Users need to operate and maintain ECS and K8s built through ECS. Another pain point is that the ECS in the K8s cluster needs to be purchased in advance. If the customer's load fluctuates greatly, there will be a lot of waste of resources. Although there are technical solutions, such as the flexibility of worker nodes, this still has a relatively high complexity for novice users.

Is there a solution that allows users to enjoy the container orchestration capabilities provided by K8s without worrying about the operation and maintenance, management, and flexibility of ECS and K8s? This is the solution of Serverless K8s. The product corresponding to Alibaba Cloud is ASK. In the ASK solution, users create an ASK cluster, but do not need to specify any ECS nodes, and then deploy images through standard K8s container orchestration and deployment. ASK will automatically build the required POD in the underlying resource pool and elastically scale it according to the user's load requirements. Users no longer need to care about LaaS layer issues such as capacity planning, ECS machine operation and maintenance, and resource limitations, which is very convenient.

2. ASK typical scene

Slide 10.JPG

What are the main scenarios where ASK is used? First of all, it can be used to run online services. The deployment mode is flexible. It can be all K8s native modes such as deployment and helm chart. Especially, it can respond to burst traffic very well. It is extremely flexible. It can complete 500 container instances in 30 seconds. . Such elastic efficiency can well support big data computing tasks, such as Spark, Presto, etc., and can also obtain resources when needed, support Pod specifications of more than 10,000, and effectively reduce customer costs.

Another very suitable scenario is for building on-demand build tasks, such as running jenkins and Gitlab-Runner in ASK. When there is a build task, it starts immediately. When there is no task, 0 consumption, the cost is minimized. Here are just some example scenarios. In fact, based on this feature of ASK, users can run many K8s native workloads that require extreme flexibility.

3. ASK features

Slide 11.JPG

ASK is completely containerized and isolated by containers. In the process of use, users do not need to operate and maintain ECS or K8s clusters, nor do they need to consider cluster upgrades, capacity planning, OS and system software issues, etc. In theory, they can provide unlimited flexible capacity. Because it is fully charged according to usage, there is no need to pay for restricted resources.

to sum up

To sum up, we can see that Alibaba Cloud has a very diverse range of products in the field of serverless today. Both function-oriented function computing, users can only focus on code, rapid development and delivery; and there are application-oriented serverless application engines, allowing users to pay more attention to the application perspective , And provides a series of capabilities around the application, including the integration of monitoring, logging, traffic and other capabilities; for users who are more accustomed to the K8s ecosystem, ASK allows users to enjoy Serverless without changing the current K8s usage habits. Advantage. A variety of products, while satisfying the demands of different users, also enable users to experience the advantages of Serverless's free operation and maintenance, ultimate flexibility, and pay-as-you-go.

Course recommendation

In order to allow more developers to enjoy the dividends brought by Serverless, this time, we have assembled 10+ Alibaba Serverless field technical experts to create the most suitable Serverless open class for developers to get started, so you can use it immediately and easily Embrace the new paradigm of cloud computing-Serverless.

Click to watch the course for free: https://developer.aliyun.com/learning/roadmap/serverless

" Alibaba Cloud native focus on micro service, Serverless, Containers, Service Mesh and other technical fields, focusing on cloud-native popular technology trends, cloud-native large-scale landing practices, and being the public account that best understands cloud-native developers."