×
Community Blog Improving Business Efficiency by 38.89% on Double 11 with Serverless Technology

Improving Business Efficiency by 38.89% on Double 11 with Serverless Technology

This blog discusses how Taobao applied serverless technology to improve its efficiency by 38.89% and ensure stability and reliability for Double 11.

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.

By Alibaba Cloud Serverless

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.

Node.js Serverless

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.

1

Path of Discovery

Midway Serverless Framework

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.

2

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

  • Midway Serverless provides the ability to adapt to different cloud platforms and provides the ability to migrate and replace serverless cloud platforms to prevent platform lock-in.
  • Provides traditional application mode and serverless mode, with the ability to migrate to each other for downgrading and capacity upgrades.

2.  Application layer that is easier to maintain and scale

  • Uses Typescript as the base language, defines base classes, and facilitates customization by upper-level application developers.
  • Commonly used plug-ins and plug-in systems are provided.
  • Provide basic functions such as problem solving and performance optimization.

3.  Openness for different business scenarios

  • It provides a basic upper-level interface to meet the needs of different developers for customized development based on different business scenarios.

Rapid Trial and Error, Highly Available R&D Model

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.

3

Solution Creation

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.

4

Model-driven, function-based programming

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.

5

The technical implementation level is mainly categorized into:

  • Data Link Design
  • Operator Panel Design
  • Code Generation Solutions

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.

6

Operator panel design mainly functions logic programming, as shown below:

7

FaaS code generation logic:

8

Stability

Provide unitized security

Through remote disaster recovery, services can be deployed in multiple locations and multiple server rooms, to provide multiple services across different locations.

9

Advantages of unitization:

  1. Just like changing tires while the vehicle is running at high speed, the frame upgrade can be done in one unit of grayscale.
  2. When a problem occurs in a single unit, you can switch to another unit to provide services.
  3. Performance evaluation can be performed on a single unit.

Monitoring Security

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.

10

Setting up multiple scenarios in advance

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.

11

When monitoring alarms occur at any point in the process, a reasonable response can be made.

Flow Limit

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.

Best Practice

12

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.

SSR: Enabling Double 11 Sessions in Seconds

13

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.

Efficient development of the middle and back-end

The integrated development model for middle and backend has the following features.

  • Front and back-end integrated development, go-live, operation and maintenance; efficient development and deployment go-live
  • No need to focus on things like servers, domain name applications, etc., users can just focus on business
  • Solve long-tail application server cost problems and control the middle and backend lifecycle appropriately.

14

Summary

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.

0 0 0
Share on

Alibaba Clouder

2,605 posts | 747 followers

You may also like

Comments