There is no better place than China for deep cultivating retail, and there is no better time than now. In 1996, the international retail giant Wal-Mart entered China and opened the first Sam's Club store in Shenzhen. Today, 25 years later, Sam's Club has millions of paying members, making it the leading membership store in China.

When the Sam's Club in Shenzhen became Wal-Mart's No. 1 store in the world for more than 10 consecutive years, Wal-Mart once again showed outstanding performance. Why can we maintain strong growth in the extremely competitive Chinese retail market? The 2020 global retail industry survey report summarized as follows: At Wal-Mart, a variety of advanced technologies are widely used to improve work efficiency. Wal-Mart’s managers believe that advanced technology in the retail market will help Wal-Mart win the competition.

01. "Customer First, Service First" Tencent Cloud Serverless Solution

Customer first is the service tenet of the retail industry. However, consumers have higher and higher requirements for shopping experience, and business iterations are getting faster and faster. For Sam's Club to remain forward-looking, online sales channels must quickly iterate and innovate to continuously create new shopping experiences for consumers.

Difficulty 1: Application release frequency is high
Sam's Club has a fast iterative business and a high frequency of application releases, basically maintaining a one-week iteration.
Difficulty 2: Guarantee the best user experience
The basic requirements for version upgrades are: no perception of users and lossless release of applications during the upgrade process.
Difficulty 3: high resource consumption
The online traffic in the retail industry is huge, and an application may require thousands of servers. When blue-green deployment is adopted, if it is published online, another thousand servers need to be backed up, which will cause a great loss in resource consumption.

(Sam's Club Blue and Green Release Architecture Diagram)

The typical development process ranges from development testing to integration testing, to pre-launch testing, and then to launch. Each development stage has a corresponding environment to support it, and each environment consumes resources and costs to keep the service online. The traditional gray version release model faces the dilemma of multiple environments, high resource consumption, and high costs.

(There are many environments and high resource consumption)

Li Yiqi, head of the Tencent Cloud Sam's Club Project, has been deeply involved in smart retail for many years, and built the technical architecture of the Sam's Club APP from 0 to 1. Adhering to Wal-Mart's strategy of using technology to help the market, Li Yiqi maintains the ultimate pursuit of technological innovation with the goal of enabling business. After comparing various solutions, Sam's Club chose the default alias gray-scale publishing strategy of Tencent Cloud Cloud Function SCF (Serverless Cloud Function).

Cloud function SCF default alias gray release

The default alias is the $default (default traffic) alias for configuring the cloud function. There are two cloud function versions fixed in the alias: one is the $latest version, and the other is the version released for the last function. The traffic parameter configured during deployment is the traffic proportion of the $latest version. By default, another part of the traffic is cut to the last released version of the current cloud function.
Every time a new function is launched, sls deploy will be deployed to the $latest version. When the version is released, first cut part of the traffic and observe it on the $latest version, and gradually switch the traffic to the $latest version when it stabilizes. When the traffic is cut to 100%, the current version is solidified, and all the traffic is cut to the solidified version.

(The default alias of the cloud function is the gray-scale release image)

Advantage 1: Risk control to ensure user experience
First, control the risk of changes. Once you find an abnormality in the new version, you can adjust the traffic ratio to roll back at any time; second, the client and cloud functions are grayed out together, even if you need to make some destructive changes, such as protocol changes, you don’t have to Worry about whether the online version is compatible with the new protocol.
Advantage 2: Fast verification to adapt to high-frequency iteration
In the serverless mode, the environment is isolated and can be released directly, which improves the research and development efficiency during high-frequency deployment, and is suitable for rapid verification of product features.
Advantage 3: Flexible expansion and contraction saves costs
Serverless automatically shrinks when there is no traffic, which can greatly save the cost of deploying multiple environments.

When encountering more complicated version release strategies, cloud function custom aliases can provide a more flexible version switching method. The configuration of custom aliases is more complicated than the default aliases, and is suitable for business scenarios that require higher grayscale publishing capabilities.

(Cloud function custom alias grayscale release image)

02. Serverless application in retail e-commerce scenarios

1. E-commerce promotion and other peak and trough-type businesses

During the e-commerce promotion period of 11.11 and 618 each year, the online channels of the retail industry face historical traffic challenges. The peak call volume of medium and large e-commerce platforms can reach tens of millions per minute, which is 10-20 times higher than daily. Flow pressure. In daily operating activities, such as boutique spikes and limited time purchases, e-commerce platforms also face typical scenarios of large traffic, high concurrency, and peak and trough user traffic.
The cloud function SCF provides flexible and scalable infrastructure and escort services to help e-commerce customers grasp business growth opportunities and calmly deal with challenges.

(Schematic diagram of e-commerce elasticity promotion)

Instant cold start

The bottom layer of the cloud function SCF adopts self-developed lightweight virtualization technology. The startup time of Micro Vm is as short as 90 milliseconds, the cold start of the function is reduced to 200 milliseconds, and it supports simultaneous expansion of tens of thousands of computing nodes.

Real-time scaling

Based on the mode of function request real-time calculation, dynamic expansion and contraction of function examples, optimization of the experience of function cold start, and control of the resource cost of function calculation.

Preset concurrency

In scenarios such as spikes and snap-ups, massive computing resources are needed instantly. Cloud function preset concurrency can support concurrent instances to be pre-started according to configuration, and "warm up" functions in advance to prepare computing resources in advance for business peaks, eliminate cold start, and reduce time consumption caused by operating environment initialization and business code initialization.

2. CPU-intensive services such as e-commerce live broadcast

Live delivery of goods has become a standard feature of online retail platforms. In e-commerce live broadcasts, professional and stable live streaming, transcoding, distribution, and playback services are required to meet the requirements of ultra-low latency, ultra-high image quality, and ultra-large concurrent visits. After the live broadcast ends, it is usually necessary to process the playback video, such as audio and video transcoding and mixing, and secondary distribution and storage of the playback video.
Compared with the self-built transcoding server, the cloud function SCF does not need to consider the utilization efficiency of the transcoding server's idle time and server operation and maintenance.

(Cloud function e-commerce live broadcast program)

Smooth migration and quick launch

It supports user-defined configuration of FFmpeg command parameters and deployment of self-built FFmpeg. The transcoding method is flexible, and it can also be easily transplanted from physical machines, cloud hosts or containers to cloud functions.

Solve the computing power bottleneck

Large-format instances support up to 128GB/64C for 4K high-definition video transcoding, combined with resource elastic scalability, effectively ensuring transcoding efficiency.

Cost advantage of pay-as-you-go

Video transcoding is a CPU-intensive service with a high computational load. It requires full decoding of the input video stream, video filtering/image processing, and full encoding of the output format. The 1 millisecond granularity of cloud functions is billed according to usage, which has significant cost advantages.

3. Event-driven services such as smart image processing

On the e-commerce platform, there are a large number of query requests and update requests for product pictures every day. In peak situations, there are tens of millions or even hundreds of millions of image processing needs every day. Traditional solutions need to build an online server and deploy a web application for image processing, and the program triggers events regularly according to certain rules.
In the traditional solution, there are three main problems:

  1. When there is no request, the vacancy rate is higher;
  2. Need to maintain a set of operation processing code;
  3. The execution method of concurrency and timers needs to be considered to ensure the timeliness of image processing.
    In the serverless architecture, the cloud function SCF provides multiple processing capabilities such as image cropping and adding watermarks to meet the image processing requirements of e-commerce businesses. At the same time, in view of the high availability requirements of image processing and storage, it can support the cross-regional high availability deployment of object storage.

(Cloud function image processing solution)

The user only needs to set the trigger + function on the cloud function SCF. When the user uploads a picture to the object storage, the function code will be triggered to process the picture and transfer the picture to a new storage bucket. In the whole process, there is no need to build a web server, no need to write trigger conditions, and no need to pay attention to business operation and maintenance.

"The Chinese market is full of competition, but the opportunities are huge. We will continue to maintain the driving force and leadership of technology, complete product iterations with higher quality and faster speed, and ensure the consumer experience every day. ."
—— Jason Wang, Technical Director of Walmart China

GitHub: github.com/serverless
Official website: cloud.tencent.com/product/serverless-catalog


账号已注销
350 声望974 粉丝