Community

Blog
×
Community Blog Serverless Computing with Alibaba Cloud Function Compute

Serverless Computing with Alibaba Cloud Function Compute

Serverless computing refers to the concept of building and running apps that do not require server management.

Cloud computing is a revolutionary technology because it essentially breaks traditional computing models, simplifies architecture, and better meets users' requirements while keeping costs at a minimum. Owing to the flexibility of cloud computing, we have seen a multitude of novel approaches to computing, one of which being serverless computing. As a concept in the next phase of cloud computing, serverless computing truly helps enterprises focus only on business and application building without worrying about the IT infrastructure.

What is Serverless Computing?

According to the Cloud Native Computing Foundation (CNCF), serverless computing refers to the concept of building and running applications that do not require server management. It describes a finer-grained deployment model where applications, bundled as one or more functions, are uploaded to a platform and then executed, scaled, and billed in response to the exact demand needed at the moment.

Serverless computing enables developers to build and run applications without managing servers and other infrastructures. An application is decoupled to fine-grained functions, which are the basic unit of deployment and running. Users only pay for resources consumed. Therefore, serverless computing relieves application developers from management of servers and other underlying infrastructures, and enables them to focus on innovation at the business layer.

1

Although serverless computing is new, the idea of "serverless" has already been around since the beginning of cloud computing. Many cloud services, such as computing and storage, are serverless. For example, Object Storage Service (OSS), the first cloud service launched by Alibaba Cloud, is a serverless storage service. Users do not need to care how data is stored on the underlying server, and they only pay for storage resources consumed.

On the other hand, "serverless" in serverless computing refers to the ability to build applications and programs without the need of managing resources, including cloud resources. Serverless computing services such as Alibaba Cloud Function Compute takes away the need to manage infrastructure and enables developers to focus on writing and uploading code.

Statistics show that in recent years, more than 70% of new services or features launched by cloud service providers are serverless. With the increasing types of serverless services on the cloud, users can quickly build elastic and high-availability cloud native applications using multiple services.

2

Features of Serverless Computing from the Function Compute Architecture Aspect

In serverless computing, the platform service manages the underlying infrastructure. Therefore, the platform service must resolve problems such as fault tolerance and resource scaling to fully utilize the capabilities of serverless computing.

The Alibaba Cloud Function Compute architecture diagram shows that the API service layer provides the functions such as authentication and metadata read/write. When a function is synchronously called, the API service module obtains the available function execution engine from the resource scheduling module, sends a request, and finally retrieves the result. When a function is asynchronously called, the API service module writes the event to Message Queue (MQ) and returns the result. The event distribution module distributes events in a similar way as the synchronous call. The figure below depicts the architecture of Alibaba Cloud Function Compute.

3

Real-time auto scaling is a core strength of Function Compute. When the user load peaks appear, the system expands resources in real time to smoothly cope with access at the peak. The following takes asynchronous event processing as an example to describe the procedure:

  1. The event is written to the event queue of Function Compute.
  2. The event distributor reads the event from the queue and calls the corresponding function to process the event.
  3. The user function processes the event.

4

The Function Compute system monitors user load changes, and each component dynamically resizes based on the user load. As shown in the preceding figure, when more events of user A are generated, the system automatically allocates more resources to user A in each link to match the event processing capability.

Function Compute adopts the multi-level resource scheduling policy. The system predicts the requirements based on the user load and water level of the resource pool and prepares computing resources in advance. Backed by years of technical accumulation of Alibaba Cloud Apsara distributed system platform, Function Compute keeps a good balance between the timeliness and accuracy of scheduling and can automatically scale in milliseconds.

Typical Use Cases of Serverless Computing

With Function Compute, users can build almost any type of applications or backend services, including backend services of Web applications, large-scale file processing, and real-time data streaming.

For example, by integrating OSS and Function Compute, a user only needs to write a function to process a single video. When a large number of video files are uploaded to OSS, multiple function instances are automatically triggered for concurrent processing.

5

To use the HTTP trigger of Function Compute, a user only needs to write a function to process a single request. When the TPS rises, Function Compute automatically expands computing resources to execute multiple function instance processing requests.

6

User Benefits of Serverless Computing

Since the launch of Alibaba Cloud Function Compute, this service has been widely used by developers in parallel processing of large-scale multimedia data, log/IoT data streaming, website backend service, and other scenarios. During actual application, serverless computing has brought great benefits to users in terms of engineering efficiency, reliability, performance, cost, and security.

Engineering efficiency: By integrating Function Compute and other cloud services, users only need to write a small amount of code to connect multiple services for a complex function. Users do not need to perform complicated operations such as server configuration/upgrade or resource scale-up/scale-down, thus greatly reducing the O&M cost.

Reliability: Users do not need to buy or maintain any server or install any software. With Function Compute, the system automatically handles errors in the infrastructure, reduces risks such as system shutdown and network interruption, and improves the system reliability.

Auto scaling: The serverless computing platform automatically resizes computing resources required by applications within milliseconds. Users do not need to care about the number of servers.

Low cost: Users do not need to reserve the capacity for computing and storage services. No fee is charged if no code runs. Research data shows that more than 70% of server resources are not fully used. Function Compute uses a new mode to achieve 100% resource usage. Practice shows that the cost can be saved by 10% to 90%.

That means with Function Compute, developers can focus on the product code without having to manage or operate the cloud or local servers or runtime. During production, users can use several hundred lines of code to implement an image processing service that can process hundreds of millions of images and is called for billions of times every day.

Conclusion

In traditional cloud computing, IaaS provides users with the experience that is almost the same as that of the traditional IT environment, and allows users to seamlessly migrate their applications to the cloud. Since everyone can now easily obtain computing resources as required, enterprises and developers face a new challenge of managing and using computing resources more efficiently. This led to development of serverless computing, which provides a way for developers to implement function as a service (FaaS). Serverless computing services, such as Alibaba Cloud Function Compute, bring huge values to users in terms of engineering efficiency, reliability, performance, cost, and security, opening a door to a beautiful new world for developers.

0 2 0
Share on

Alibaba Clouder

821 posts | 117 followers

You may also like

Comments

Alibaba Clouder

821 posts | 117 followers

Related Products

  • Function Compute

    Alibaba Cloud Function Compute is a fully-managed event-driven compute service. It allows you to focus on writing and uploading code without the need to manage infrastructure such as servers.

    Learn More
  • OSS(Object Storage Service)

    An encrypted and secure cloud storage service which stores, processes and accesses massive amounts of data from anywhere in the world

    Learn More
  • Container Service

    A high-performance container manage service that provides containerized application lifecycle management

    Learn More