Why the author | but (burning)

Introduction: Serverless, once beautiful and always watched, has gradually entered the landing stage. In this year’s “National Day travel”, Autonavi scaled up its core business Serverless, and the business supported by Serverless performed very well in peak traffic. Traditional apps can provide the same experience, so what’s the differentiating value of Serverless? This article shares the practice summary behind autonavi Serverless scale implementation.

With the further popularization of the Serverless concept, developers have moved from a wait-and-see state to a trial phase, and more landing scenarios are being unlocked. “Is Serverless only suitable for small scenarios?” “, “Can it only be event-driven? These early doubts about Serverless are dissipating, and users are adopting Serverless technology in more core scenarios for efficiency, flexibility, and cost optimization. As a leader in map application, Autonavi has been continuously exploring new technologies to bring better travel experience to users, and has achieved remarkable results in its large-scale implementation of core business Serverless.

During the “National Day Travel Festival” in 2020, Amap set a record — by 13:27:27 on October 1, 2020, amap had over 100 million active users on that day, 3:41 minutes earlier than October 1, 2019.

During this period, Serverless, as one of the core technology scenarios, smoothly withstood the test of peak traffic. It is worth mentioning that the business supported by Serverless performed very well during peak traffic, with nearly two million function calls per minute. This reaffirms the value of Serverless’s base technology and further expands the technology scene.

The business scenario

Autonomous travel is the core business of Amap, which involves users’ travel related functional demands and carries the largest user traffic in amAP APP. The following figure shows some scenes of Node FaaS application in the core business of autonomous travel. From left to right, they are the main picture scene page, route planning page, and navigation end page.

With the further expansion of its functions, Amap has been upgraded from a navigation tool to a travel service platform and life information service entrance, which further expands the life information service scenes related to travel and brings users a more comprehensive user experience. The above function is a scene recommendation card, which aims to recommend information according to users’ travel intentions and improve users’ travel experience. This feature requires the ability to iterate quickly and adjust styles with high flexibility. Therefore, it is undoubtedly the best choice to store the card style template in the cloud and render it to the client in the form of service delivery, which can meet the purpose of fast and flexible business iteration.

According to the evaluation of the scheme, this scenario belongs to stateless service. Based on the mature ecosystem of Ali Cloud Serverless, Autonavi finally chooses to access Node FaaS (Ali Cloud function computing) service capability and set up scene recommendation card service in front of travel. The UI template acquisition, data request aggregation & logical processing, and the ability of Schema generation by splicing are all realized in FaaS layer. The client can directly render and display the Schema delivered by the service to achieve the goal of more portability and flexibility.

Then, how does the Serverless scenario perform in the peak scenario of the “National Day Travel Festival”?

The overall service success rate was greater than 99.99%, with a total of 100W+ times of trigger/minute and QPS of 2W+. The average service response time of all scenarios was below 60ms, and the service stability exceeded expectations.

The business value

From the support for the above business scenario, we can see that Serverless is doing very well. Of course, you might ask, traditional apps can provide the same experience, so what’s the value of Serverless differentiating?

1. Simple efficiency improvement

Traditional BFF (back-end For front-end) layer applications will gradually become “rich” over time and business requirements will increase, with more redundant code, and finally become a developer’s nightmare — “all at once”. As people iterate, module developers change, and the BFF layer slowly becomes a module that no one knows about and dares to touch.

What happens when the BFF layer is converted to the SFF (Serverless For Front-end) layer? SFF’s responsibilities will become single, zero operation, and lower cost, which are inherent capabilities of Serverless, and these capabilities can help the front-end further unlock its production potential. Developers no longer need a rich BFF layer, but only need an interface or an SFF to implement functionality, naturally solving the problem of “one thing at a time”. If the interface stops working or there is no traffic, the instance will automatically shrink to zero. In this way, it is easy to identify the interface function. In the future, you can delete the interface function to effectively improve resource utilization.

Autonavi is very advanced in Serverless application, realizing the complete docking between FaaS layer and research and development system. Therefore, the whole life cycle of application from development, testing, gray scale and on-line to standardization ability of flow control, elasticity and disaster recovery has been shortened by 40% compared with before, greatly improving human efficiency.

2. Flexibility and cost

Through the traffic trend data, we can observe the traffic characteristics of the map scene — the difference between peak and low peak is very obvious. According to the resource preparation of traditional application, we need to make resource preparation according to the peak flow, so when the flow is low, the machine with more preparation will have a lot of redundancy, which causes the waste of cost.

In view of the above situation, Autonavi uses Ali Cloud function calculation, which can automatically expand and shrink capacity according to flow changes. However, the complexity of increasing the capacity expansion speed has always been the exclusive domain of large enterprises, but functional computing can popularize the capacity expansion ability of fast up and fast down to users by virtue of millisecond startup advantage, which easily helps users realize the elastic utilization of computing resources and greatly reduces the cost.

3. Observability

Observability is an essential attribute of the online application diagnosis platform. Users should be able to observe RT changes, resource utilization rate, and full-link invocation of system applications, so as to quickly diagnose the bottleneck problems of system applications. Ali Cloud function computing takes the lead in perfect integration with log service, cloud monitoring, tracing platform and function workflow layout. Users only need to configure once to fully enjoy these functions, which greatly reduces the learning cost of users and enables rapid diagnosis of applications.

The prelude of Serverless scale implementation has been opened, and more scenarios are being unlocked in all walks of life. Serverless scale in Autonavi, for the business side, business iteration faster and more flexible, for business innovation to create the premise; For front-end developers, it further activates the developer’s production potential and improves the great ability confidence. Autonavi travel business from the ability pilot at the beginning of 2020 to the core scene of autonomous travel in the “National Day Travel Festival”, during which alibaba cloud function computing was connected, accumulating valuable experience in cloud native landing, and laying a good foundation for the overall cloud business in the future.

About the author: Yiran (Yiran), Alibaba’s front-end technology expert, joined AmAP in 2016, and is currently responsible for autonavi travel business research and development and Serverless related technology implementation.