One, foreword

With Serverless landing in all cloud platforms in the industry, Ali’s internal Serverless RESEARCH and development platform and various research and development modes are also gradually landing in the business, in full swing. Under this opportunity, Amoy team launched the Serverless R&D mode upgrade campaign, based on ali Group’s infrastructure construction and upper technology system, to solve the series of problems encountered in Amoy light store business scenarios, and to promote the transformation of the existing front and back end cooperation mode.

Second, the background

Light store business is a new business of Tao Department, which is currently in the stage of trial and error exploration. How to cooperate with the business quickly with low labor costs is a problem that the team needs to consider at present. One of the important features of Serverless is “only focus your business”. Therefore, embrace Serverless, light shop business imperative. This paper mainly introduces how to land Serverless technology in the front end team of Light shop, and how to promote the upgrade of light shop research and development mode and improve the efficiency of research and development. On this basis, the possibility of transforming front-end functions into application development is explored.

Iii. Upgrading of research and development mode

Firstly, this paper investigates the current situation of Alibaba Group internal and external Serverless, and makes technology selection based on its own business characteristics. Subsequently, the business was implemented in the light store domain, and the following capabilities were gradually implemented in the landing process: sidecar&bottle was used as the bottom support, and the integrated research and development mode was combined with the public service layer, atomic capability layer and basic SDK to improve the research and development efficiency; Finally, through the light store standard R & D link to ensure business stability; Finally, the FaaS system of light store was formed, and the efficiency improvement and upgrading of r&d mode was preliminarily realized.

1. Technical status quo

Ali Group BU has done a lot of work in the Serverless field in the past year, mainly focusing on infrastructure construction, RESEARCH and development mode, logical arrangement, stability construction, as well as opening up faAS link and deploying it to business scenarios of SIDE B and side C, as shown in the figure below. The Serverless platform that each business depends on is concentrated in C platform/F platform (PS: Alibaba internal Serverless platform).

2. Technical selection

Currently, The Serverless platform of Ali Group has in-depth cooperation with the Midway FAAS team to customize the Aladdin FAAS solution, which relies on kangaroo as the business gateway to carry the responsibility of request distribution, and has universal capabilities such as disaster recovery and bottom-saving. Kangaroo is based on tianma system (PS: refers to the building system based on unified module specifications), but the bottom of the light store business depends on the decoration system. Therefore, we need to re-model the faAS solution to implement the light store scenario. In addition, the light shop business core depends on a variety of services. Most of these mid-platform services are provided in the form of rich clients (PS: two-party packages with integrated local capabilities). How to use rich clients in nodeFaaS system is the focus of our technical solution. The following is the link comparison diagram of PLATFORM C (PS: Serverless platform inside Ali) and platform G (PS: Serverless platform inside Ali).

Among them, THE link of G platform has the ability of bottle to provide rich client solutions, and the overall system has fewer link levels and better performance. Therefore, the final technology selection is G platform. As a business side, I worked with all platforms to promote the implementation of G platform solution in the front-end FaaS scenario.

3. FaaS system of light store

With the business landing, capacity precipitation, light shop FaaS into the system.

Light shop FaaS (code: Hawksbill), has the basic ability layer, including interface aggregation, data mapping, function bottom, gray scale, etc. The atomic service layer precipitates the packaging of various medium platform capabilities of the light store business scenarios, and the upper layer provides the basic SDK to directly use various capabilities to the business. Light store FaaS in the business landing, and the front-end module to form the light store business SaaS capabilities, through the solution to combine business capabilities, service light store various business scenarios.

1) SideCar & Bottle

The core business of light shop relies on the capability of China platform and middleware. Therefore, the first problem to be solved is how to invoke rich client and middleware capabilities under nodeFaaS technology architecture.

The Store is working with the G platform and Midway FaaS team to develop Node FaaS capabilities for the G platform. In G Serverless platform, there are two containers on one POD. Sidecar container is mainly responsible for request discovery, distribution, protocol parsing and providing various service capabilities (middleware and mid-platform services). The function container runs the Node Runtime and the business FAAS code on it. Containers communicate with each other through GRPC. Finally, business code can invoke rich client/middleware capabilities through the bottle-SDK. As shown below:

Based on the above scheme, FaaS realized the capability map of light store business scenarios. The middleware layer mainly focuses on message queue (metaQ), operation and maintenance (Switch, Diamond), service (HSF, MTOP, HTTP), cache (TAIR, Redis), database (cloud RDS), scheduling (Schedulerx) and so on. In Taiwan, the capacity is concentrated in commodities, merchants, stores, coupons, labels, stores, UIC and so on. With the development of business, in the gradual enrichment.

2) Hawksbill FaaS capability

In the running state of Hawksbill, G platform and Node Rutime are used as the bottom platform to realize business Faas functions through atomic layer capabilities, and provide unified data aggregation, bottom-feeding and other capabilities in the common layer. In the research and development state, the integrated r&d link of light store is realized based on the unified RESEARCH and development platform and small program end, including the unified construction and release process, UI configuration mapping, FaaS function automatic completion, etc. As shown below:

Public layer

API requests come in, first through the public layer (code: Antelope). The common layer mainly implements the basic common capabilities in the light store domain. For example, the ability to customize the ability to put, bottom, aggregation, configuration. Among them:

  • Customized putting ability is to get through ALxding (PS: Alxding refers to the general internal putting platform of Ali Group), businesses can customize the configuration of voting rules, such as voting data according to merchants, crowds, regions and business dimensions;
  • Bottom-saving capability: For the C-end interface that needs to ensure high availability, even if the interface fails, the bottom-saving capability can be implemented by backing up data, so that consumers have no sense of service abnormalities;
  • The aggregation capability is to deliver the decoration data of the light shop page and the internal data of the module in a unified manner to improve page performance and prevent page jitter. And on the basis of uniform delivery of services, the implementation of page level, interface level of the bottom, module plug-in gray capacity.

Atomic capability layer

The atomic capability layer is the encapsulation of various mid-stage capabilities (store model, commodity model, coupon model…) for the business scenarios of light stores. . Based on these atomic capabilities, FaaS unified convergence of external dependencies, business can reduce the cost of external docking, realize business functions, but also provide a basis for mapping completion capability.

FaaS-SDK

In order to improve efficiency, FaAS-SDK is abstracted from The light store, including various platform adaptation, caching capability, logging specification, locking capability, database encapsulation, common tools and so on. Among them:

  • The adaptation of platform scenarios includes Severless platforms within Ali Group, so that developers have no awareness of the platform and only need to pay attention to the business logic itself.
  • The light store system provides multi-level caching capability, and provides technical support for high-availability scenarios with high RT requirements;
  • General log specification: Formats INFO and ERROR logs in FaaS scenarios and encapsulates them into independent packages for service use.

Integrated research and development mode

On the basis of common layer capability layer, atomic layer capability layer, SDK, and Sidecar & Bottle, we open up the r&d link between small program module and FaaS, and realize the integrated r&d mode of light store.

The integrated development model refers to the development of small program modules based on the end, while implementing FaaS capabilities in the same project. Reference the FaaS code directly in the front-end code as a function call, without a request; And in the whole research and development link, realize both ends of the synchronous creation & release. In the light store scenario, this research and development mode saves the cost of communication and coordination between the front and back ends and greatly improves the research and development efficiency.

The stability of

Finally, in order to ensure the reliability and stability of the business, Light Store defines the standard R&D link of light Store FaaS. Different measures are configured for each stage of the R&D life cycle (r&d status, to go online, going online, and after going online) to ensure service stability. As shown below:

So far, the FaaS system of Light store has been introduced. Sidecar supports the underlying capabilities, and 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 standard R&D link.

Through FaaS system of light store, we support light store business, cover complete business from front to back in front, and focus on capacity building in middle and Taiwan in back end. The front-end functions gradually change from the front-end to the full stack, from resources to business partners. For the whole business, the team’s overall efficiency can be improved with less collaborative communication cost and less joint adjustment cost. Since then, the light store team has initially realized the upgrade of the research and development mode.

4. Business implementation status

At present, Tao department light store FaaS, has landed in a number of light store business.

Four, in the future

In the future, tao team will continue to explore the best efficiency improvement practice of integrated R&D mode on the basis of faAS system.

Activity recommended

In 2021, Serverless is coming! Aliyun Serverless Developer Meetup will be launched in Shanghai on Saturday, April 24. We invited technical experts from Aliyun, Feizhu and Autonavi to discuss the problems to be solved and excellent experience in the actual production of Serverless in the past year, disclose the actual process of Serverless in Autonavi, Feizhu and other enterprises, and detail Serverless Devs 2.0. How to solve Serverless application development pain points more effectively. Stamp me to sign up now!