The Alibaba Cloud 2021 Double 11 Cloud Services Sale is live now! For a limited time only you can turbocharge your cloud journey with core Alibaba Cloud products available from just $1, while you can win up to $1,111 in cash plus $1,111 in Alibaba Cloud credits in the Number Guessing Contest.
Last year, Taobao started adopting serverless for the Double 11 shopping festival and achieved amazing results; and now Alibaba has gradually applied serverless technology to all aspects of the frontend. In this article, we will explain how the serverless technology used in the 2020 Double 11 can help you scale your business in core scenarios.
In app and web development, Node.js is frequently viewed as a valuable weapon, where it plays a flexible and lightweight role in helping to improve business efficiency. Today, Node.js Serverless has expanded its influence from the backend to the frontend. The team at Taobao has been applying Node.js Serverless technology during this year's Double 11 festival, along with Alibaba Cloud Serverless Function Compute and other infrastructure, at scale in various business scenarios. This year, requests reached new levels, with a peak total of 50,000 QPS, compared to 2,000 QPS of last year, while the CPU level was raised from last year's average FaaS level of 20% to 40%.
In terms of business value, Node.js Serverless supports the "cloud all-in-one" (云端一体 in Chinese) development model, and delivers an average efficiency improvement of 38.89%. This year, Alibaba relied on the convenience and reliability of Alibaba Cloud Function Compute to quickly apply SSR technology on the landing pages of Taobao, Tmall, and Flying Pig to improve the user experience of these pages. In terms of operation and maintenance, we focused on optimizing the rush state and daily state process to reduce developers' effort by about 50% when dealing with higher QPS scale. In terms of R&D experience, we built a solution system to reduce the difficulty of R&D and support outsourcing for fast entry.
In the following sections, we will introduce our development solutions and experiences from Double 11, as well as from our daily projects, and provide some real cases of Node.js Serverless based on Alibaba Cloud Function Compute.
Since the deployment model and runtime environment were different from traditional Node.js applications, we upgraded the existing Node framework and proposed the Midway Serverless framework.
Midway Serverless is a serverless-oriented solution that includes a framework, a runtime, a toolchain, and configuration specifications.
In the framework design process, we focused on the following aspects.
1. Multi-platform adaptability
2. Application layer that is easier to maintain and scale
3. Openness for different business scenarios
By unifying the cloud development platform, we were able to build a more agile process for frontend application development from R&D to delivery. We also made a Vscode plug-in and local scaffolding to improve the local development experience for developers.
In terms of the release platform, we built a code cloud by streamlining the release chain, and finally compress the hot-loaded codes into packages. At function runtime, we used hot scheduling mode to speed up the function start time.
At the same time, we worked with various teams from business-side and accumulated various solutions from past practices. The business side can customize its own tenants and can also choose general solutions and combine it with their own gateway.
Driven by models, function scheduling outputs FaaS functions. In combination with the existing building system, developers can schedule modules, build pages, and quickly respond to the business needs related to Double 11.
The technical implementation level is mainly categorized into:
The so-called data link design mainly defines DSL by design, which provides structured storage of data sources, models, fields, access parameters, and code fragments.
For example, code fragments are defined as follows.
Operator panel design mainly functions logic programming, as shown below:
FaaS code generation logic:
Through remote disaster recovery, services can be deployed in multiple locations and multiple server rooms, to provide multiple services across different locations.
Advantages of unitization:
We have connected to a full-link tracking system at the Runtime level of the framework to make it easier for developers to check the link status of errors.
This allows our service teams to focus only on the QPS and success rate of their own business functions. If the success rate drops, or QPS drops, the team will be alerted via IM, SMS or phone.
The following chart shows the daily QPS changes for a function.
In order to cope with unprecedented risks that may exist at each stage of the process, at the architecture level, we ensure that Double 11 goes smoothly by setting up multiple scenarios in advance.
When monitoring alarms occur at any point in the process, a reasonable response can be made.
Based on the traffic in the 2019 Double 11 festival, we estimated the flow scale for this year's Double 11. We carried out a number of tests, including station building pressure measurement, single-link stress test, and full-link stress test. Based on the stress test performance, we configured flow restriction for each component of the flow link to protect the service.
This year, we were able to squeeze in more CPU consumption at the container level while maintaining the same QPS, which is twice as much as last year.
The upgrades to the development model in 2.2 allow developers to quickly choose from a wide range of common solutions and respond quickly to business needs to produce front-end features that meet business scenarios. Ultimately, the Double 11 virtual venue can realize a wide variety of scenarios with the functionality provided by frontend developers.
With SSR server-side rendering + Serverless model, frontend developers can further improve the user experience by optimizing the front and backend together. It helped the Double 11 branch session to significantly improve the page opening speed and also improved the business conversion.
The integrated development model for middle and backend has the following features.
Serverless is the foundation for the future of software development. Frontend developers can leverage Serverless to deliver business quickly. Whereas in the past, front-end development was often limited by resources, today, driven by creativity, Serverless allows front-end development to be free of resource and cost constraints, while rapidly iterating on the business through the use of Node.js. As a result, development is far more efficient than traditional models, and the cost is relatively low. That's what we're continuing to do in front-end development, and the combination of Serverless and multi-tendency technology will lead to a huge leap forward in the entire front-end development model.
We strive to validate our serverless product through continuous practice. By combining Alibaba Cloud Function Compute with the Midway Serverless framework, we can offer our front-end solutions to users and get more people using serverless technology to create the ultimate "cloud-integrated" experience.
A Deep Dive Into DinamicX: Enabling Visually Impaired People to Shop Online
Alibaba Cloud Achieved Large-Scale Implementation of Serverless in Core Business Scenarios
2,624 posts | 721 followersFollow
Alibaba Clouder - December 11, 2020
Alibaba Clouder - November 25, 2020
Alibaba Clouder - November 16, 2020
Alibaba Clouder - November 16, 2020
Alibaba Clouder - December 4, 2020
Alibaba Container Service - April 11, 2019
2,624 posts | 721 followersFollow
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
An online computing service that offers elastic and secure virtual cloud servers to cater all your cloud hosting needs.Learn More
A powerful and accessible data visualization toolLearn More
More Posts by Alibaba Clouder