How to solve the pain of Serverless landing?

Introduction: In the context of the lack of best practices for Serverless, this year, on Double 11, Alibaba Cloud achieved the first large-scale implementation of Serverless in the core business scenario in China, withstood the world’s largest traffic peak, and created a serverless application. milestone. How does Alibaba Cloud make serverless from concept to implementation to all walks of life?

In the process of traditional business development and online, teamwork is required. Each person develops a part, merges the code, develops joint debugging, and then conducts resource evaluation, test environment construction, online environment construction, test launch, operation and maintenance. However, in the serverless era, developers only need to develop their own functions/functions, and then deploy them to the test environment and online environment. A large part of the later operation and maintenance work does not need to be considered or worried.

Today, everyone has questions about whether to use Serverless, largely because of the lack of successful cases and best practices. This year, on Double 11, Alibaba Cloud achieved the first large-scale implementation of Serverless in the core business scenario in China, and held the world's largest traffic peak, creating a milestone in the application of Serverless.

cage-holography-1044215_1920.png

How to let more enterprises and developers apply Serverless to business scenarios, that is, to make Serverless from concept to implementation, is a thorny issue.

For example, how to migrate traditional projects to Serverless while ensuring the business continuity of the migration process, how to provide comprehensive development tools, effective debugging and diagnostic tools under the Serverless architecture, and how to use Serverless to save costs are all difficult problems. Especially when it comes to the large-scale implementation of Serverless in mainstream scenarios, it is not easy. Because of this, the industry's call for the large-scale implementation of serverless best practices in core business scenarios is even more urgent.

Next, let's take a look at the pain points that Serverless will encounter in the process of landing.

The pain of Serverless landing

Pain point 1: Cold start takes a long time

Fast play is a natural attribute of Serverless, but the condition of fast play is to have the ultimate cold start speed to support. For non-core services, the millisecond-level delay is almost unaffected by the business. However, for core business scenarios, delays exceeding 500 milliseconds have already affected the user experience. Although Serverless uses lightweight virtualization technology to continuously reduce the cold start, it can even be reduced to less than 200 milliseconds in some scenarios.

But this is only an ideal stand-alone operation scenario. On the core business link, users not only run their own business logic, but also rely on back-end services such as middleware, database, and storage. The connection of these services must be started in the instance. Time to establish a connection, which invisibly increases the cold start time, and then extends the cold start time to the second level. For core online business scenarios, a second-level cold start is unacceptable.

Pain point 2: Separation from the R&D process

Serverless's main scenario is to write business code like writing business functions, which can be launched simply and quickly, allowing developers to write code on the cloud and easily complete the launch. However, in reality, the requirements of the core business pull developers from the cloud back to reality, facing several soul tortures: how to do testing? How to go online in grayscale? How to do business disaster recovery? How to control permissions? When the developers have answered these questions, they will become discouraged. It turns out that in the core business online, "functions are running normally" only occupies a small part, and the distance from the online is as long as the Yangtze River.

Pain point 3: The connectivity problem of middleware

The core online business does not run in isolation as an independent function. It needs to connect to storage, middleware, and data middle and back-end services, obtain the data and then calculate, and then output and return to the user. Traditional middleware clients need to get through a series of operations such as connecting to the client's network, initializing and establishing connections, which often slows down the function startup speed a lot. In the serverless scenario, the instance life cycle is short and the number is large, which will cause frequent connection establishment and large number of connections. Therefore, network connectivity is optimized for the client of the middleware commonly used in online core applications, and the call link is opened for monitoring data. Helping SRE (Site Reliability Engineer) practitioners better evaluate the downstream middleware dependencies of functions is very important for serverless migration of core applications.

Pain point 4: Poor observability

Most of the users’ core business applications use microservice architecture, and the core business application problems will also have microservice characteristics. For example, users need to perform very detailed inspections on various indicators of the business system, not only need to check business indicators , It is also necessary to check the resource indicators of the system where the business is located, but there is no concept of machine resources in the serverless scenario, how can these indicators be revealed? Is it possible to meet the needs of the business side only by revealing the error rate and concurrency of the request?

In fact, the needs of the business side are much more than that. Whether the observability is good or bad depends on whether the business side trusts your technology platform. Good observability is an important prerequisite for winning the trust of users.

Pain point 5: remote debugging is difficult

When there is an online problem in the core business, it is necessary to immediately enter the investigation, and the first element of the investigation is: reservation on the spot, and then log in for debugging. In the serverless scenario, there is no concept of the machine level, so if a user wants to log in to the machine, it is difficult to do so based on the existing serverless basic technology. Of course, the reasons are not limited to this, such as Vendor-lockin's concerns.

The summary of the above categories of pain points is mainly for the developer's development experience. In the actual development scenario, whether it is really "efficiency" rather than new bottles of old wine. At present, most core application developers still have a wait-and-see attitude towards Serverless. Of course, there are also some doubtful views that FaaS is only suitable for small business scenarios and non-core business scenarios.

Is it true?

Serverless Double 11 "Big Test"

In December 2019, the consulting firm O'Reill released a serverless usage survey, and 40% of respondents' organizations have adopted serverless. In October 2020, the "China Cloud Native User Survey Report" released by the China Academy of Information and Communications Technology pointed out: "Serverless technology has risen significantly, and nearly 30% of users have been applied in production environments."

In 2020, more and more companies choose to join the serverless camp, and they are eagerly waiting for more cases of serverless implementation in core scenarios.

Faced with the steady growth of the number of serverless developers, Alibaba formulated the strategy of "Building Servrelss Double 11" at the beginning of the year. The goal is not only to prevent traffic and peak, but to actually reduce costs and improve resource utilization. , Through the "Double 11 Technology Alchemy Furnace", Alibaba Cloud Serverless will become a safer, more stable, and more friendly cloud product to help users achieve greater business value.

Different from Double 11 in the past 11 years, after the core system of Tmall Double 11 went to the cloud last year, Alibaba has realized full cloud native based on the digital native commercial operating system, and the upgrade of the underlying hard core technology has brought surging momentum. And ultimate performance. Taking support for the peak order creation as an example, the IT cost per 10,000 peak transactions has dropped by 80% compared to four years ago, and Serverless has also ushered in the first large-scale landing in the core scenario of Double 11.

Scenario 1: Front-end multiple scenarios

On Double 11 in 2020, the front end of Alibaba Group fully embraces cloud-native serverless. Taoxi, Fliggy, AutoNavi, CBU, ICBU, Youku, Koala, etc., have jointly implemented cloud integrated research and development centered on Node.js FaaS online service architecture mode. On Double 11 this year, under the premise of ensuring stability and high resource utilization, the key marketing shopping guide scene of multiple business lines has realized the upgrade of the research and development model. The delivery of the cloud-integrated R&D model supported by front-end FaaS increased the efficiency by 38.89% on average. Relying on the convenience and reliability of Serverless, Taobao, Tmall, Fliggy and other double 11 venue pages quickly implemented SSR technology, which improved the user page experience. In addition to guaranteeing big promotions, it also reduced the computing cost by 30% compared with the past under daily flexibility.

image.png

Scenario 2: Personalized recommendation scenario

Serverless's natural elastic scalability is the most important reason for choosing Serverless for the "personalized recommendation business scenario". Thousands of heterogeneous application operation and maintenance costs have always been a pain point in this scenario.

Further release operation and maintenance through serverlessization, allowing developers to focus on business algorithm innovation. At present, the application scope of this scenario is getting wider and wider, and it has covered almost the entire Ali APP: Taobao, Tmall, Alipay, Youku, Fliggy, etc., so we can do more optimizations on the utilization of machine resources. Intelligent scheduling, the machine resource utilization rate reached 60% at peak time.

image.png

Scene three: middle and backstage scenes

In 2020, Century Lianhua Double 11 will be based on Alibaba Cloud Function Computing (FC) elastic expansion, and will be applied in many scenarios such as SSR, online merchandise spike, coupon distribution, industry shopping guide, data center computing, etc. Peak QPS exceeded 230% of Double 11 in 2019, improved R&D efficiency delivery by more than 30%, and reduced flexible resource costs by more than 40%.

image.png

Of course, there are many scenarios that apply to Serverless, and developers from more industries need to enrich them. In general, this year's FaaS report card is very dazzling. In the Double 11 promotion, not only did part of the core business be undertaken, but the traffic also broke new highs, helping the business to withstand the traffic peak of one million QPS.

How does Alibaba Cloud overcome the pain points of Serverless?

So, how did Alibaba Cloud overcome the pain of serverless landing in the industry?

1. Reserve mode + quantity-based mode to eliminate cold start

In the major upgrade of Serverless 2.0 in 2019, Alibaba Cloud Function Computing took the lead in supporting the reservation mode, and then AWS Lambda also launched a similar function a few months later.

Why did Alibaba Cloud take the lead in solving this problem?

The Alibaba Cloud Serverless team is constantly exploring the needs of real business. Although the pay-as-you-go model is very attractive, the cold start time is too long, so the core online business is shut out. Next, Alibaba Cloud focused on analyzing the demands of core online businesses: low latency and ensuring resource elasticity . How to solve it?

Please see the figure below. This is a very typical business curve. The reserved mode is used to meet the fixed amount at the bottom and the elasticity is used to meet the demand of burst. For burst expansion, we use a combination of two expansion methods to meet: resource expansion and request expansion. For example, users can only set the expansion threshold of CPU resources to 60%, and expansion will be triggered when the instance's CPU reaches the threshold. The new request at this time does not immediately reach the expanded instance, but waits for the instance to be ready before diversion, thus avoiding a cold start. Similarly, if only the expansion threshold of the concurrency index is set to 30 (the concurrency carried by each instance), the expansion of the same process will also be triggered when this condition is also met. If both indicators are set, the condition that is met first will trigger the expansion first.

image.png

Through a wealth of scaling methods, Alibaba Cloud Function Computing solves the problem of serverless cold start and well supports delay-sensitive businesses.

2. Core business research and development efficiency improvement by 38.89%

"Improving efficiency" should be the advantage of serverless, but for core applications, "fast" = "high risk". Users need to go through several process verifications such as CI testing, daily testing, pre-launch testing, and gray deployment. Ensure the quality of the function. These processes are a stumbling block that prevents core applications from using FaaS.

In response to this problem, the strategy of Alibaba Cloud Function Computing is to "be integrated", combining the advantages of the R&D platform with Alibaba Cloud Function Computing, which can not only meet the user's CI/CD process, but also enjoy the serverless dividends, helping users Bridging the gap in using FaaS.

Alibaba Group internally integrates the R&D platform of each core application through the exposed standard OpenAPI. After the verification of Double Eleven business R&D, the R&D efficiency has been greatly improved by 38.89%. Integrate with the cloud efficiency platform on the public cloud, integrate the R&D process with FaaS more closely and smoothly, and help businesses outside the group improve human efficiency.

image.png

3. Middleware connectivity

Core applications are inseparable from upstream and downstream cooperation. Once the core applications use functional computing, how should they cooperate with middleware?

Traditional application development needs to integrate various middleware SDKs to be packaged and launched. However, for serverless functions, the size of the code package is a flaw. This problem will directly affect the cold start time. Alibaba Cloud Function Computing has undergone two phases of development. In the first phase, we build a middleware proxy to open up the middleware through the proxy. The function only uses a single protocol to interact with the proxy, thus offloading the SDK of the middleware.

The second stage: With the sinking of middleware capabilities, some control requirements have also been put on the agenda, such as: command issuance, traffic management, configuration pull, etc. During this period, Alibaba Cloud embraced the open source component Dapr, Interaction costs in the middle of Offload using Sidecar. The above solution is based on the Custom Runtime of Alibaba Cloud Function Computing and the Custom Container function.

image.png

4. The ultimate development experience

Remote debugging, log viewing, link tracking, resource utilization, and improving peripheral tool chains are necessary capabilities for developers. Alibaba Cloud Function Computing has also launched different research teams.

First, it combines with Tracing/ARMS to create a clear link tracking capability, and integrates with SLS to create a comprehensive business data monitoring. Therefore, the business can be customized according to needs, and embracing the open source product Prometheus exposes the resource utilization rate and supports WebIDE with remote debugging capabilities.

In addition, Alibaba Cloud has recently opened up the heavyweight weapon: Serverless-Devs, a developer tool that has no vendor binding and helps developers to double the efficiency of development/operation and maintenance under the Serverless architecture. Developers can simply and quickly create applications, project development, project testing, release and deployment, etc., to achieve project lifecycle management.

image.png

Serverless has many initial pain points. Why can Alibaba Cloud implement Serverless in all walks of life?

First , Alibaba Cloud provides the most complete serverless product matrix among all cloud vendors, including function computing FC, serverless application engine SAE, ASK for container orchestration, and ECI for container instances. The rich product matrix can cover different scenarios. For example, for event-triggered scenarios, function computing provides rich event source integration capabilities and extreme flexibility of 100 milliseconds scaling; for micro-service applications, the serverless application engine can achieve zero-code transformation. Let microservices also enjoy Serverless dividends.

Secondly , Serverless is a rapidly developing field, and Alibaba Cloud is constantly expanding the product boundaries of Serverless. For example, function computing supports multiple industry-first functions such as container mirroring, prepaid mode, and concurrent execution of multiple requests within an instance, which completely solves serverless problems such as performance glitches caused by cold start, and greatly expands the application scenarios of function computing.

Finally , Alibaba Group has very rich business scenarios, which can further polish the serverless landing practice. This year, Alibaba Group's Tao Department, Koala, Fliggy, AutoNavi, etc. all used Alibaba Cloud Function Computing FC in the core business scenarios of Double 11, and successfully managed the peak of double 11 traffic.

Serverless leads the next decade

"The most radical labor productivity, as well as the greater proficiency, skill, and judgment in the use of labor, seem to be the result of the division of labor."

This is an excerpt from "The Wealth of Nations", which emphasizes the stakes of "division of labor". For any industry, the larger the market size, the finer the division of labor will be. This is also the famous "Smith Theorem."

Similarly, this theorem also applies to the software application market industry. As traditional industries have entered the Internet-based stage, the market size has become larger and the division of labor has become more and more refined. The physical machine hosting era has become history and has been replaced by the mature IaaS layer, followed by container services. It is also standard in the industry.

So, what will be the next decade of technology? The answer is: Serverless.

Serverless smooths out the lack of R&D personnel in budget and operation and maintenance experience. In the face of business peaks, most R&D can be easily controlled, which not only greatly reduces the R&D technology threshold, but also greatly improves R&D efficiency , Online early warning, traffic observation and other tools are all available, easily achieving free operation and maintenance of technology research and development.

It can be said that Serverless is a more fine-grained division of labor, so that business developers no longer pay attention to the underlying operation and maintenance, and only focus on business innovation, which greatly improves labor productivity. This is the "Smith theorem" effect, and Serverless is also an inevitable trend in the future The internal reason.

Currently, the entire cloud product system has been serverless, and more than 70% of products are serverless. Serverless products such as object storage, messaging middleware, API gateways, and table storage are already well known by developers. In the next decade, Serverless will redefine the cloud programming model and reshape the way enterprises innovate.

It is worth looking forward to!

Scan the QR code to learn more.

Official QR code.jpg

[More exciting]

1. Explosive middleware products are discounted, and Alibaba’s ten-year best practices are deeply decrypted. Click to understand now: https://www.aliyun.com/activity/daily/commercial?spm=5176.20960838.0.0.6a54305etoEn4D

2. [Fill in the questionnaire to get the doll] Click to fill in the questionnaire now:
https://survey.aliyun.com/apps/zhiliao/YmW95Gk8bU

[Join the industry actual combat exchange nail group]

Alibaba Cloud has specially established the "Internet Architecture Upgrade Practical Course" Dingding Group, which invites an Alibaba Cloud expert to live broadcast industry best practices in the group every week, sharing cutting-edge dry goods in the industry every day, and Dingding scans the code to join immediately.

image.png

Original link: https://developer.aliyun.com/article/780230?

Copyright statement: The content of this article is voluntarily contributed by Alibaba Cloud real-name registered users. 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 that there is 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.

Guess you like

Origin blog.csdn.net/alitech2017/article/details/112471668