In 2009, the University of California, Berkeley published a paper "The Berkeley View on Cloud Computing", which correctly predicted the evolution and popularization of cloud computing in the next ten years.
In 2019, Berkeley released another paper "A Berkeley View on Serverless Computing" with the same naming style, once again predicting that "serverless computing will develop into the main form of cloud computing in the future." Serverless has high hopes, but there are also some controversies.
Now, it has been seven years since Amazon Lambda was first released in 2014. Looking back, can all the serverless promises be fulfilled?
Promises and Disputes
The term "serverless" first appeared in an article around 2012. The author Ken Fromm explained it as follows:
The term "serverless" does not mean that servers are no longer involved, it just means that developers no longer need to consider so much physical capacity or other infrastructure resource management responsibilities. By eliminating the complexity of the back-end infrastructure, serverless allows developers to shift their attention from the server level to the task level.
Although many technology prophets believe that serverless architecture is "a major innovation and will soon become popular", this concept did not get a good response when it was put forward.
The event that really made serverless gain widespread attention was the launch of Amazon Lambda by Amazon Cloud Technology in 2014. Later, as the services of companies such as Google and Microsoft entered the market, "serverless" has gradually become a "hot word" in the industry.
Compared with "traditional services", the main advantages of serverless computing are as follows:
- A better automatic expansion and contraction method can theoretically cope with sudden demand peaks from "zero" to "infinity". The decision about expansion is provided by the cloud provider on demand, and developers no longer need to write an automatic expansion strategy or define rules for the use of machine-level resources (CPU, memory, etc.).
- Traditional cloud computing charges based on reserved resources, while serverless charges based on function execution time. This also means a more fine-grained management approach. Using resources on a serverless framework only pays for the actual running time. This is in sharp contrast to traditional cloud computing charging methods, where users need to pay for computers that have idle time.
- As the next iteration of cloud computing, serverless computing allows developers to focus more on building applications in products, without the need to manage and maintain the underlying stack, and is cheaper than traditional cloud computing. Therefore, serverless computing is known as "development The fastest way for new applications, but also the way with the lowest total cost."
The "Berkeley View" even believes that serverless computing provides an interface that greatly simplifies cloud programming. This shift is similar to "migrating from assembly language to high-level programming language."
Since its inception, "serverless" has been placed high hopes, but there will inevitably be controversies in the development process. Some of the issues involved before are:
- Programming language is restricted. Most serverless platforms only support running applications written in a specific language.
- Supplier lock-in risk. There are almost no cross-platform standards in the way "functions" are written, deployed, and managed. This means that migrating "functions" from one vendor-specific platform to another is very time-consuming and laborious.
- Performance issues such as cold start. If a "function" has not been run on a specific platform before, or has not run for a period of time, then it will take some time to initialize.
2019 is considered a year of significant development for serverless. At the end of the year, Amazon Cloud Technology released Amazon Lambda’s "Provisioned Concurrency" feature, which allows Amazon Cloud Technology serverless computing users to keep their functions "initialized and ready in double-digit milliseconds." The status of "internal response" means that the problem of "cold start" is a thing of the past, and the industry has reached a point of maturity.
Although this technology still has a long way to go, as more and more companies, including Amazon Cloud Technology, Google, and Microsoft, invest in this technology, we have seen continued growth in serverless adoption.
According to the Serverless State Report released by Datadog in 2021, developers are accelerating the adoption of serverless architecture: After 2019, the usage rate of Amazon Lambda has increased significantly. At the beginning of 2021, the average daily call frequency of Amazon Lambda functions was 3.5 times that of two years ago. And half of the new Amazon Web Services users have adopted Amazon Lambda.
Although the shares of Microsoft and Google have risen, Amazon Lambda, as a pioneer in serverless technology, has maintained a leading position in terms of adoption rate, and half of function as a service (FaaS) users are using Amazon Cloud Technology services. According to data released by Amazon Web Services, hundreds of thousands of customers are already using Amazon Lambda to build their services.
See the evolution of
Amazon Lambda is an event-driven computing engine. Amazon Cloud Technology released a preview version of this feature at the Amazon Cloud Technology re:Invent conference in November 2014. This immediately caused competitors to follow up. Many companies began to provide similar services on the cloud. Google released Cloud Functions in February of the following year, IBM also released Bluemix OpenWhisk in the same month, and Microsoft released a preview in March of the following year. Version Azure Functions, etc.
On the product page of Amazon Web Services, Amazon Cloud Technology defines Amazon Lambda as: “Users can run code without pre-setting or managing infrastructure. Just write the code and upload it as a .zip file or container image. Can."
A simple use case is that the Seattle Times uses serverless technology to automatically adjust the image size required for display on mobile, tablet, and desktop devices. Whenever an image is uploaded to Amazon Simple Storage Service (S3), it will trigger Amazon Lambda function call execution The function to adjust the image size. The Seattle Times only pays Amazon Web Services after resizing the image.
The key development of Amazon Lambda
For teams exploring serverless technology, understanding Amazon Lambda is critical. Although serverless is not equivalent to Amazon Lambda, since its release in 2014, Amazon Lambda has almost become synonymous with Amazon Serverless services. In fact, Amazon Lambda needs to work with other tools to form a complete serverless architecture, such as sending HTTP requests through Amazon API Gateway, or calling resources in Amazon S3 buckets, Amazon DynamoDB tables, or Amazon Kinesis streams.
In the early days of the launch, only Amazon S3, Amazon DynamoDB, and Amazon Kinesis were available for Amazon Lambda functions. But since then, Amazon Cloud Technology has gradually integrated many other services for Amazon Lambda functions, such as Amazon Cognito authentication, Amazon API Gateway, Amazon SNS, Amazon SQS, Amazon CloudFormation, Amazon CloudWatch, and so on.
When it was launched in 2014, Amazon Lambda only supported Node.js. At the end of 2015, Java support was added to Amazon Lambda, and Python support was added in 2016. Up to now, Amazon Lambda natively supports Java, Go, PowerShell, Node.js, C#, Python and Ruby code, and provides Runtime API, allowing users to write functions in any other programming language.
With Amazon Lambda, in addition to uploading code (or building code in the Amazon Lambda console), users also need to select memory and timeout period to create a function.
Initially, the Amazon Lambda function timeout period was 30 seconds, which was later extended to 5 minutes. In October 2018, Amazon Web Services set the timeout period to 15 minutes. From then on, users can run longer functions and perform tasks such as big data analysis, batch data conversion, batch event processing, and statistical calculations more easily.
The Amazon Lambda function allocates CPU and other resources linearly based on the configured amount of memory. At the end of 2020, the memory limit of Amazon Lambda functions has been adjusted to 10 GB, which is more than 3 times more than before. This also means that users can access up to 6 vCPUs in each execution environment, allowing users to multi-thread and Multi-process programs run faster.
In the seven years since its release, all aspects of the Amazon Serverless service have been continuously improved:
In 2016, Amazon Cloud Technology released Amazon Step Functions, which can combine and call multiple Amazon Lambda functions and other Amazon services, and visually express complex business logic as a low-code, event-driven workflow.
In 2017, Amazon Lambda's default concurrency increased to 1,000, and X-Ray, a distributed tracking tool, was provided.
In 2018, Amazon Cloud Technology released the Amazon Aurora Serverless v1 version, officially announcing that more complex relational databases (RDBMS) can also have the characteristics of Serverless, realizing the automatic start-stop and elastic expansion of cloud databases based on load.
With the evolution of cloud services, Amazon Cloud Technology has successively released five Serverless database services, including Amazon Aurora Serverless, Amazon DynamoDB, Amazon Timestream (a time series database service), Amazon Keyspaces (a managed database service compatible with Apache Cassandra) and Amazon QLDB (a fully managed ledger database).
At present, Amazon Aurora Serverless has evolved from v1 to v2. Aurora Serverless v2 can scale database workloads from hundreds of transactions to hundreds of thousands of transactions in one second. Compared with the cost of configuring capacity for peak loads, It can save up to 90% of database costs.
In 2019, Amazon Cloud Technology released Amazon EventBridge, a serverless event bus service that connects to Amazon Web Services services, custom applications, and SaaS applications as a centralized hub, providing events from event sources to target objects (such as Amazon Lambda and other SaaS applications) real-time data streaming. Amazon Lambda can now be integrated with more than 200 Amazon Web Services services and SaaS applications.
In the same year, Amazon Cloud Technology also launched Amazon S3 Glacier Deep Archive, which further improved the smart charging level of S3 storage services based on the degree of read and write cold and heat.
In 2021, Amazon Lambda's billing function is adjusted to the 1ms level, and it also provides container image support and Amazon Graviton2 processor support. Compared with similar products based on x86, Amazon Graviton2 can increase the cost-effectiveness by up to 34%.
cold start and vendor lock
The performance improvement of "cold start" can be regarded as a landmark event. It takes some time for the FaaS platform to initialize the function instance. Even for the same specific function, the startup delay between different platforms may vary greatly, ranging from a few milliseconds to a few seconds, depending on a large number of factors such as the library used, the computing power of the function configuration, and so on. Taking Amazon Lambda as an example, the initialization of Amazon Lambda functions is either a "warm start" or a "cold start". A "warm start" is to reuse the Amazon Lambda function instance and its host container from the previous event. A "cold start" requires the creation of a new container instance to start the function host process. When considering start-up delay, "cold start" is more concerned.
Amazon Cloud Technology provides an important new feature called "Provisioned Concurrency" in 2019, which can more accurately control the startup delay by keeping the function in the initialized state. All the user needs to do is to set a value to specify how many instances the platform needs to configure for a specific function, and the Amazon Lambda service itself will ensure that there are always this number of warm-up instances waiting to work. "Cold start" is undoubtedly the biggest problem pointed out by critics of serverless technology, and the emergence of this feature of Amazon Cloud Technology means that the controversy about "cold start" has ended.
In addition, "vendor lock-in" is also a highly controversial place. A few years ago, as an opponent of serverless technology, CoreOS CEO Alex Polvi called Amazon Lambda's serverless product "one of the worst forms of proprietary lock-in we have seen in human history." Matt Asay, who works for MongoDB, retorted him, saying, "The way to completely avoid lock-in is to write all the underlying software (event model, deployment model, etc.) by yourself."
In short, as a supporter, many people think that "locking" is not a black and white thing, but an architectural choice that itself needs to be weighed repeatedly. Some technical experts said that the design method of separating the application and the platform, and the method of standardized technology can be adopted to minimize the migration cost: If you use standardized HTTP, you can use Amazon API Gateway to convert the HTTP request into the Amazon Lambda event format; If you use standardized SQL, using Amazon Aurora Serverless, which is compatible with MySQL, can naturally simplify the database migration path...
best practice case
Up to now, in which scenarios will users use serverless computing? In fact, at the annual Amazon Cloud Technology re:Invent conference, some teams will share practical experience with you, and there are many representative cases.
At the 2017 Amazon Cloud Technology re:Invent conference, Verizon's Revvel team introduced how they used Amazon Lambda and Amazon S3 to transcode different video formats. Earlier the team used an EC2 instance. If the video is as long as 2 hours or as large as several hundred G, the problem becomes very difficult. HD conversion may take 4-6 hours, and once the conversion is stopped or interrupted in the middle of the conversion work, it means that all previous efforts have been lost. . Therefore, the new method adopted by the Revvel team is to divide the video into 5M pieces and store them in Amazon S3 buckets, and then use Amazon Lambda to enable thousands of instances of parallel computing. After the transcoding is completed, they are combined into a complete video. The process was shortened to less than 10 minutes, and the cost was reduced to one-tenth of the original cost.
At the 2020 Amazon Cloud Technology re:Invent conference, Coca-Cola's Freestyle device innovation team shared their contactless vending machine solution: using Amazon Lambda and Amazon API Gateway to build a back-end hosting service, and the front-end using Amazon CloudFront , So that the prototype can be launched within a week, and the web application can be expanded from the prototype to 10,000 machines within three months, and then quickly occupy the market during the epidemic.
In this year's Amazon Cloud Technology re:Invent conference keynote speech, Dr. Werner Vogels described the serverless solution in the New World Game multiplayer game.
This is a very complex large-scale distributed real-time game, which can handle 30 times/s actions or states, and requires a lot of CPU resources for redrawing and calculations. It stores the user's state in Amazon DynamoDB through 800,000 writes every 30 seconds, so that the user can restore the previous game state in time even if the game is interrupted unexpectedly. At the same time, it records user operations through logs, and then uses Amazon Kinesis to transmit log events at a rate of 23 million events per minute. Then the event stream is pushed to Amazon S3, and then Amazon Athena is used for analysis and processing. Using this data stream, the team can instantly predict game user behavior and change strategies in the game. Operations in the game environment, such as login, transaction, notification and other operational events, are all implemented through Amazon Lambda serverless computing.
Serverless has played a very important role in this multiplayer game, but this large-scale architecture also poses a very big challenge to serverless performance. Amazon Lambda has reached a frequency of 150 million calls per minute, which is several times higher than the industry average.
future
At the end of this year, Amazon Cloud Technology launched five serverless products in one go:
Amazon Redshift Serverless can automatically configure computing resources and use SQL to analyze structured and unstructured data across data warehouses, operational databases, and data lakes.
Amazon EMR Serverless (Preview) is a new option in Amazon EMR that allows data engineers and analysts to use open source analysis frameworks, such as Apache Spark, Hive, and Presto, to run PB-level data analysis in the cloud.
Amazon MSK Serverless (public preview), a new type of Amazon MSK cluster, is fully compatible with Apache Kafka, and there is no need to manage Kafka capacity. The service will automatically provision and expand computing and storage resources.
Amazon Kinesis On-demand is used for large-scale real-time streaming data processing, and the service will automatically expand and shrink as needed.
Amazon SageMaker Serverless Inference (Preview) allows developers to deploy machine learning models for inference without configuring or managing the underlying infrastructure, paying according to the execution time and the amount of data processed.
From this, we can see that there are more and more serverless services on the cloud, and the capabilities of serverless computing have expanded from computing, storage, and database services to data analysis and machine learning inference. In the past, machine learning inference required a large amount of resources to support peak requests. If you use EC2 inference nodes, idle resources will push up costs, while using Amazon Lambda services, you don’t need to think about cluster node management. The service will automatically preset, expand, and shut down computing capacity according to Workload, just for execution time and processing. Paying for the amount of data can save a lot in comparison.
While Amazon Serverless services continue to evolve, the computing architecture is also constantly improving. For example, users can configure the original Intel x86 processor to Amazon Graviton2 ARM processor through the options provided by the platform, which has faster performance and can be 20% cheaper. Some technical experts believe that the platform will also develop in a more intelligent direction. "Now users need to change the configuration and choose a cheaper ARM processor. In the future, the service can automatically select the computing platform."
As an evolution of cloud computing, the vision of serverless is bound to change our view of writing software. There has never been a way to consider how to design with millions of processor cores and petabytes of memory like cloud computing, but now serverless has entered the general and usable stage, and users do not need to consider how to manage these resources.
As Dr. Werner Vogels said in the keynote speech: “If you don’t use cloud computing, these large-scale architectures are simply impossible to achieve. So now, use the architecture that belongs to the 21st century to build the system of your dreams (Build systems the way you always wanted to, but never could)."
Reference materials:
https://www.datadoghq.com/state-of-serverless/
https://readwrite.com/2012/10/15/why-the-future-of-software-and-apps-is-serverless/
https://www.youtube.com/watch?v=xZ3k7Fd6_eU
https://www.serverless.com//guides/amazon-s3
https://aws.amazon.com/cn/blogs/compute/new-for-aws-lambda-predictable-start-up-times-with-provisioned-concurrency/
https://www.techrepublic.com/article/cloud-lock-in-why-the-enterprise-doesnt-care/
https://www.thoughtworks.com/en-sg/insights/blog/mitigating-serverless-lock-fears
https://martinfowler.com/articles/oss-lockin.html
https://aws.amazon.com/cn/lambda/resources/customer-talks/
American Telecom Verizon case: https://www.youtube.com/watch?v=lleCVR2Mupw
Coca-Cola Freestyle case: https://aws.amazon.com/cn/solutions/case-studies/coca-cola-freestyle/?pg=ln&sec=c
New World Game multiplayer game example: https://www.youtube.com/watch?v=8_Xs8Ik0h1w
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。