“Live up to the time, the creation of non-stop, this article is participating in 2021 year-end summary essay competition”

Since Serverless Framework entered China in 2019, I have started the technical preaching and operation work in the Serverless field. Every year, people ask questions about Serverless. From what is Serverless to how far is Serverless from mass adoption? 2022 is coming, three years have passed, I would like to take this article as a summary of the work!

Serverless, which translates as “Serverless” in Chinese, is regarded as the development direction of the new generation of cloud computing. More and more industries and companies adopt Serverless technology because of its advantages of significantly reducing development costs, automatic expansion and reduction on demand, and free operation and maintenance.

To evaluate the prospects of a technology, look at the nature of the technology and see what it can really bring.

▎ Serverless origin

In 2009, UC Berkeley published A paper titled “Above the Clouds: A Berkeley View of Cloud Computing,” which accurately predicted the evolution of Cloud Computing over the next decade. [1]

Ten years later, in the paper “Cloud Programming Simplified: A Berkeley View on Serverless Computing describes the concept of Serverless, and again predicts the challenges and problems to be solved for Serverless. [2]

In UC Berkeley’s description, Serverless Computing is a simplified way to use the cloud. Serverless Computing can be approximated as FaaS + BaaS.

There’s a nice metaphor in the paper: Serverless dramatically simplifies programming based on cloud services, like assembly language to high-level programming languages.

In general, Serverless has the following characteristics:

  1. The server concept is hidden. The server still exists, but developers do not need to carry out tedious development and operation and maintenance operations for the server;

  2. Provides a pay-as-you-go model and does not charge when resources are idle;

  3. Provides the ultimate flexibility to scale, so that computing resources can be perfectly adapted to business needs.

Looking at the history of cloud computing, Serverless is well positioned to tap into the next phase of cloud computing:

In the process of deploying physical machines to VMS, cloud computing allocates computing power resources more efficiently by virtualization. Containers were born in the cloud computing boom for more granular distribution. Is it possible to go one step further and assign power to a business execution as a unit? Resources are allocated once each time they are executed, otherwise they are not consumed.

The answer is the Serverless cloud function.

It is not hard to see that Serverless’s transformation of programming model is a great motivator for developers, allowing them to focus on business implementation and pushing the boundaries of capabilities.

▎ isn’t just an idea, Serverless is starting to shine

At a time when cloud computing was still trying to educate the market, Serverless’s idea was a huge hit with developers, and what better way to develop than that?

Amazon first introduced Lambda at the Amazon Cloud Re: Invent Global Conference in 2014. Coupled with the release of API Gateway in the following year, Serverless started to emerge with existing cloud services. It was no longer an academic concept, but a product that could be applied in practice.

Lambda is a serverless event-driven computing service that runs code in response to events and helps developers automatically manage underlying computing resources. Of course, you only pay for what you use.

Lambda runs code on a high availability computing infrastructure that performs all management of computing resources. This includes server and operating system maintenance, capacity allocation and elastic scaling, code and security patch deployment, and code monitoring and logging. As a developer, you only need to provide the code.

Here is an example of a mobile back end: build a serverless back end using Amazon Cloud Tech Lambda to handle Web, mobile, Internet of Things (IoT), and third-party API requests.

As an event-driven service, Lambda can automatically run code in response to multiple events, for example, HTTP requests sent through the Amazon API Gateway, object modifications in Amazon S3 buckets, table updates in Amazon DynamoDB, and state transitions in Step Functions.

This leads to the second layer of Serverless. In addition to computing power, the integration and data storage layers can also be Serverless:

  • In terms of application integration, there are EventBridge, Step Functions of workflow orchestration, managed API Gateway and other services.
  • In terms of data storage, we are familiar with object storage S3, DynamoDB database and other services.

Modern applications have matured by building on Serverless at the computing, integration, and data storage levels.

A Serverless survey from the Serverless community shows that Amazon Cloud Technology is by far the most widely used Serverless provider, with 96% of respondents using Lambda. [3]

▎’s bold promise: You just write business code

Later, the emergence of OpenFaaS, Serverless Framework, Apache OpenWhisk and other open source software makes Serverlss more and more concerned, and some concerns gradually appear.

The first is the “cold start” shown in blue. Although the time spent setting up the environment and code is not charged, it adds latency to the overall duration of the call. This affects some time-delay sensitive services.

In addition to using microVM performance improvements to lift latency, you can also reduce cold starts by using “preconfigured concurrency” techniques. For example, it is possible to pre-heat the Lambda with a specific amount and time of pre-heating, and the effect is the same as calling an activated function [4].

This means that all setup activity takes place before the call, including running the initialization code:

At the same time, state management and sharing remain difficult due to the stateless nature of Serverless. So when we talk about Serverless, we should also look at it dialectically: Serverless can perform well in some scenarios, and not so well in others.

File processing, stream processing, Web applications, IoT backends, and mobile backends are the most common application scenarios for Serverless.

The Revvel team at Verizon talked about how they used Lambda and S3 to transcode video in different formats — the team started with EC2 instances, which can take 4-6 hours to convert to HD. The new method is to divide the video into 5M pieces and store them separately in S3, and then use Lambda to enable thousands of instances of parallel calculation, complete transcoding and then combine them into a complete video. The whole process is shortened to less than 10 minutes, and the cost is also reduced to one tenth of the original.

This is a typical example of using Serverless in the right scenario.

In addition, Lambda has made many improvements of its own. For example, Lambda functions can now be configured to run for up to 15 minutes per execution [5]. Compared with the previous 5 minutes tripled, good for big data analysis and batch event processing and other businesses.

For memory or computationally intensive workloads, such as machine learning, high performance computing (HPC), etc., up to 10 GB of memory can be allocated for Lambda functions. This is more than three times the previous limit. At the same time, Lambda allocates CPU and other resources linearly based on the amount of memory configured. This means that up to six Vcpus can now be accessed in each execution environment.

In one study, Lambda calls were 3.5 times higher than two years ago, and cold start delays were much shorter than a year ago. [6]

It is both a pathfinder and a leader.

Lambda started from Serverless’s traditional art, solved the “innate problem” of cold startup, and improved based on business. At this time, it seems not a big deal to see Amazon CTO Werner Vogels claim that “in the future, only business logic is the only code you need to write”.

▎ Gives full play to data value, Serverless is the trend

What exactly are we talking about when we talk about computer science? In a nutshell — computing power, algorithms, data.

In recent years, Moore’s Law has become increasingly difficult to maintain, and chips have not gotten much faster or more memory dense.

The future of Serverless is to provide a more efficient way to allocate computing power so that developers can easily get more computing resources from the Serverless architecture. For computing scenarios such as machine learning, there are also similar workflow scheduling and environment configuration capabilities to support.

With a lot of computing power, data can be better used. This year, Amazon introduced Amazon EMR Serverless, which uses open source big data frameworks such as Apache Spark, Hive, and Presto to run analytics applications without a management server. The cooperation between upstream and downstream services can further improve platform performance, efficiency and reliability in common scenarios, and enable Serverless to apply to more application scenarios.

These moves also point to a future of more, cheaper and faster services on the cloud.

Finally, there are hardware developments. Currently, cloud computing relies heavily on X86 architecture. Serverless can consider introducing a new architecture and let users choose the most suitable hardware to process tasks, thus achieving higher utilization rate and stronger performance. The first few months have seen support for the ARM architecture [7], which bodes well for developers.

In terms of the development of the whole industry, from physical machines to cloud hosts to Serverless architecture, serverization is becoming more and more obvious.

At the beginning of this article, I said that to evaluate the prospects of a technology, we should start from the essence of the technology and see what it can really bring. For Serverless, in the words of Gu Fan, general manager of Amazon’s Greater China Product department, “providing the ultimate ease of use to customers” **

reference

  1. (^) (www.zhihu.com/question/50… The Clouds: A Berkeley View of Cloud Computing “www2.eecs.berkeley.edu/Pubs/TechRp…
  2. (^) (www.zhihu.com/question/50… Programming Simplified: A Berkeley View on Serverless Computing “www2.eecs.berkeley.edu/Pubs/TechRp…
  3. (^) (www.zhihu.com/question/50… Of the Serverless Community Survey Results www.serverless.com/blog/state-…
  4. (^) (www.zhihu.com/question/50… Lambda: Performance optimization aws.amazon.com/cn/blogs/co…
  5. (^) (www.zhihu.com/question/50… Lambda functions can run for up to 15 minutes aws.amazon.com/cn/about-aw…
  6. (^) (www.zhihu.com/question/50… The state of serverless www.datadoghq.com/state-of-se…
  7. (^) (www.zhihu.com/question/50… : ARM comes to Lambda awsteele.com/blog/2021/0…