Upgrading practice of serverless R & D mode for mobile Taobao light store business

Time:2021-5-7

Introduction:With the implementation of serverless in various cloud platforms in the industry, Alibaba’s internal serverless R & D platform and various R & D modes are gradually implemented in the business, which is in full swing. Under this opportunity, the Taoxi team launched the upgrading campaign of the light store’s serverless R & D mode. Based on the construction of the underlying facilities and the upper technical system of Alibaba group, the team solved a series of problems encountered in the business scenario of Taoxi light store, and promoted the transformation of the existing front-end and back-end cooperation mode.

Upgrading practice of serverless R & D mode for mobile Taobao light store business

1、 Preface

With the implementation of serverless in various cloud platforms in the industry, Alibaba’s internal serverless R & D platform and various R & D modes are gradually implemented in the business, which is in full swing. Under this opportunity, the Taoxi team launched the upgrading campaign of the light store’s serverless R & D mode. Based on the construction of the underlying facilities and the upper technical system of Alibaba group, the team solved a series of problems encountered in the business scenario of Taoxi light store, and promoted the transformation of the existing front-end and back-end cooperation mode.

2、 Background

Light store business is a new type of business of Amoy department, which is in the trial and error stage of exploration at present. How to cooperate with the business quickly with low labor cost is the problem that the team needs to consider at present. One of the important features of serverless is “only focus on your business”. Therefore, it is imperative to embrace serverless and light store business. This article mainly introduces how to implement the serverless technology in the front-end team of the light store, and how to promote the upgrading of the R & D mode of the light store and improve the R & D efficiency. On this basis, the possibility of transforming front-end function into application development is explored.

3、 R & D mode upgrade

Firstly, this paper investigates the current situation of serverless inside and outside Alibaba group, and makes technology selection based on its own business characteristics; Then, the business was implemented in the light store domain, and the following capabilities were gradually implemented in the process of implementation: Taking sidecar & bottle as the underlying support, using the integrated R & D mode combined with the public service layer, atomic capability layer and basic SDK to improve the R & D efficiency; Finally, the service stability is guaranteed through the standard R & D link of light store; Finally, the FAAS system of light stores was formed, and the R & D mode was initially upgraded.

1. Technical status

In the past year, each Bu of Alibaba Group has done a lot of work in the field of serverless, mainly focusing on infrastructure construction, R & D mode, logic layout, stability construction, and the business scenario of connecting the FAAS link and landing on the B-side and C-side, as shown in the figure below. The serverless platforms that each business relies on are concentrated on C platform / F platform (PS: Alibaba internal serverless platform).

Upgrading practice of serverless R & D mode for mobile Taobao light store business

2. Technology selection

At present, Alibaba Group’s serverless platform and midway FAAS team have cooperated in depth, customized Aladdin based FAAS scheme, relying on Kangaroo as business gateway, carrying the responsibility of request distribution, and having common capabilities such as disaster recovery and disclosure. Kangaroo is the first mock exam based on the PS system, which is based on the unified module specification. But the light store business depends on the decoration system. Therefore, we need to re select the FAAS solution based on light store scenario. In addition, the core business of the light store relies on a variety of mid-range services. Most of these mid-range services are provided in the form of rich client (PS: a two-party package integrating local capabilities). How to use the rich client in the nodefaas system is the focus of our technical solution. The following is the link comparison diagram of the C platform scheme (PS: serverless platform inside Alibaba) and the G platform scheme (PS: serverless platform inside Alibaba).

Upgrading practice of serverless R & D mode for mobile Taobao light store business

Among them, the G platform link has the bottle ability to provide rich client solutions, the overall system link level is less, and the performance is better, so our final technology selection is g platform. As the business side, we will work with all platforms to promote the implementation of the G platform solution in the front-end FAAS scenario.

3. FAAS system of light store

With the implementation of business and the precipitation of capacity, FAAS of light stores has gradually become a system.

Light store FAAS (code name: hawksbill), withBasic capability level, including interface aggregation, data mapping, function details, grayscale, etc.Atomic service layer, which encapsulates various middle platform capabilities of light store business scenarios, and the upper layer provides the basic SDK to directly use various capabilities for business. When the business of FAAS is implemented, FAAS and the front-end module form the commercial SaaS capability of the light store. Through the solution, the commercial capability is combined to serve various business scenarios of the light store.

1)SideCar & bottle

The core of light store business relies on the ability of middle platform and middleware. Therefore, the first problem to be solved is how to call the rich client and middleware capabilities under the nodefaas technology system.

The light store, together with G platform and midway FAAS team, promotes the ability of developing node FAAS based on G platform. In G serverless platform, there are two containers on a pod. Sidecar container is mainly responsible for request discovery, distribution, protocol resolution, and providing various service capabilities (middleware and midrange services); The function container runs node runtime and runs business FAAS code on it. Containers communicate with each other through grpc. Finally, the business code can call the rich client / Middleware capabilities through the BOT SDK. As shown in the figure below:

Upgrading practice of serverless R & D mode for mobile Taobao light store business

Based on the above scheme, FAAS of light store realizes the capability map to meet the business scenario of light store. The middleware layer mainly focuses on message queue (metaq), operation and maintenance (switch, diamond), service (HSF, MTop, HTTP), cache (tail, redis), database (cloud RDS), scheduling (schedulerx), etc. The ability of Zhongtai focuses on commodities, merchants, stores, coupons, labels, stores, UIC, etc. With the development of business, it is gradually enriched.

Upgrading practice of serverless R & D mode for mobile Taobao light store business

2) Hawksbill FAAS capability

In the running state, hawksbill takes g platform and node runtime as the underlying platform, implements business FAAS functions through the capabilities of the atomic layer, and provides data aggregation and disclosure capabilities in the public layer. In the R & D state, the integrated R & D link of light store is realized based on the unified R & D platform and small program end, including unified construction of release process, UI configuration mapping, automatic completion of FAAS function, etc. As shown in the figure below:

Upgrading practice of serverless R & D mode for mobile Taobao light store business

Public layer

API requests come through the public layer (code name: antelope). The public layer mainly realizes the basic general ability in the light store domain. For example, user-defined delivery ability, bottom-up ability, aggregation ability and configuration ability. Among them:

  • Custom delivery capabilityIt is to get through AXD (PS: AXD refers to Alibaba Group’s internal general delivery platform), and business can be customized to configure fixed investment rule items, such as fixed investment data by business, population, region and business dimension;
  • The ability to get to the bottomFor the C-end interface that needs to ensure high availability, even if the interface is hung up, it can also disclose the details through backup data, so that consumers have no perception of service exceptions;
  • Aggregation capabilityIs the light store page decoration data and module internal data unified distribution, improve page performance, prevent page jitter. And on the basis of unified distribution service, it can realize page level, interface level, and module plug-in gray level capability.

Atomic capability layer

The atomic capability layer is the encapsulation of all kinds of middle platform capabilities (store model, commodity model, coupon model, etc.) in the business scenario of light store. Based on these atomic capabilities, light store FAAS converges external dependencies, reduces external docking costs, realizes business functions, and provides the basis for mapping and complementing capabilities.

FaaS-SDK

In order to improve efficiency, light store abstracts FAAS SDK, including platform adaptation, caching capability, log specification, locking capability, database encapsulation, general tools, etc. Among them:

  • Adaptation of platform scenariosIt includes severless platforms in Alibaba group, so that developers have no perception of the platform and only need to pay attention to the business logic itself;
  • Under the light store systemMulti level cache capabilityTo provide technical support for high availability scenarios with high RT requirements;
  • General log specificationThe format of the info and error logs in FAAS scenario is standardized, and packaged into independent packages for business use.

Integrated R & D mode

On the basis of public layer capability layer, atomic layer capability, SDK and sidecar & bottle, we get through the small program module and FAAS R & D link to realize the integrated R & D mode of light store.

Integrated R & D mode refers to the development of small program modules based on the end, and the realization of FAAS capability in the same project. In the front-end code, FAAS code is directly referenced as function call without request; And in the whole R & D link, the two ends are created & released synchronously. In the light store scenario, this R & D Mode saves the cost of front-end and back-end communication and joint debugging, and greatly improves the R & D efficiency.

stability

Finally, in order to ensure the reliability and stability of business, the light store defines the standard R & D link of FAAS. Different measures are configured in each stage of R & D life cycle (R & D status, to be launched, on-line and after launch) to ensure business stability. As shown in the figure below:

Upgrading practice of serverless R & D mode for mobile Taobao light store business

So far, the FAAS system of light store has been introduced. Sidecar is used to support the underlying capabilities. The integrated R & D mode combines the public service layer, atomic capability layer and basic SDK to improve the R & D efficiency. Finally, the stability is guaranteed through the standard R & D link.

Light store business is supported by FAAS system of light store. The front-end covers the whole business from front to back, and the back-end students focus on the capacity building of middle platform. The front-end functions gradually change from the front-end to the whole stack, from resources to business partners. For the whole business, with less cost of collaborative communication and joint debugging, the overall efficiency of the team can be improved. Since then, the light store team has initially upgraded its R & D mode.

4. Business implementation status

At present, Taoxi light store FAAS has established its business in several light store domains.

Upgrading practice of serverless R & D mode for mobile Taobao light store business

4、 The future

In the future, the Amoy team will continue to explore the best practice of integrated R & D mode based on the FAAS system of light stores.

Activity recommendation

In 2021, serverless is coming!On April 24 (Saturday), Alibaba cloud’s serverless developer meetup will appear in Shanghai.We invited people fromAliyun, Feizhu, GaodeTo discuss the problems to be solved and excellent experience of serverless in the actual production in the past year, to disclose the actual combat process of serverless in Gaode, Feizhu and other enterprises, and to detail serverless devs 2.0, how to more effectively solve the pain points of serverless application development.I’ll sign up now!

Copyright notice:The content of this article is spontaneously contributed by alicloud real name registered users, and the copyright belongs to the original author. The alicloud developer community does not own its copyright, nor does it bear the corresponding legal responsibility. For specific rules, please refer to the user service agreement of alicloud developer community and the guidelines for intellectual property protection of alicloud developer community. If you find any suspected plagiarism content in the community, fill in the infringement complaint form to report. Once verified, the community will immediately delete the suspected infringement content.