×
Community Blog How ApsaraDB for Redis Supports for the November 11 shopping spree

How ApsaraDB for Redis Supports for the November 11 shopping spree

In this article, we will introduce Alibaba Cloud's ApsaraDB for Redis by using several typical business scenarios encountered during Alibaba's Double Eleven (Singles' Day) festival.

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.

Since the inception of Alibaba's Double Eleven (Singles' Day) online shopping festival in 2009, ApsaraDB for Redis has proven that that it could provide full assurance to businesses during this important and demanding event. Currently, ApsaraDB for Redis provides a standard single copy, a standard dual copy, and a cluster edition.

The standard single and dual copies feature high compatibility and support Lua scripts and geographic location computation. The cluster edition provides large capacity and high performance, which breaks through the performance limitations of the single-thread, standalone Redis.

ApsaraDB for Redis works in dual-host hot standby mode by default and supports backup and recovery. It is under continuous optimization and upgrade of Alibaba Cloud's Redis team and comes with powerful security defense capabilities. Here, we introduce this product using several November 11 business scenarios. These scenarios have been simplified for the purpose of easy understanding.

Storing Data for the Weitao Community

The Weitao Community is Taobao's social network for hundreds of millions of Taobao users. Taobao users can specify their followers' lists and the sellers can maintain the data of their regular customers or followers. The main challenge of maintaining a social network of this scale is the storage of the social relation for every user. The overall social relation is as follows.

1

If a traditional relational database model is used to express the relation chain, this complicates business design and turns out to be inferior performance. The Weitao Community uses a cluster of ApsaraDB for Redis to cache followers' chains, which simplifies the storage of followers data and guarantees a smooth business experience during November 11. The Weitao Community uses Hashes to store the relation chains. The storage structure is as shown in the following figure and the following two interfaces are provided for querying:

  1. Whether Users A and B are followers of each other
  2. List of items User A is following

2

Paginating Comments to a Live Broadcast in Tmall

When mobile users view live broadcasts during November 11, they can get more comments to the live broadcasts in three ways:

  1. Incremental pull down: Gets a specified number (increment) of comments from the specified position up.
  2. Pull-down refresh: Gets a specified number of the latest comments.
  3. Incremental pull up: Gets a specified number (increment) of comments from the specified position down.

The wireless live broadcasting system uses Redis to optimize the business scenario. This guarantees not only the success rate for the live comment interface but also over 50,000 transactions per second (TPS) and a request response time in milliseconds. The live broadcasting system writes two sets of the data for each broadcast, indexes, and comments. The indexes are written in SortedSet data structure to sort comments, while comments are stored in Hashes. A comment can be retrieved after an index is used to obtain the index ID, which is used to read the Hashes and to obtain a list of comments. A comment is written in the following process:

3

After a user refreshes the list, the background retrieves the corresponding comments. This process is as follows:

  1. Retrieve the index ID.
  2. Retrieve the index list.
  3. Retrieve the comment.

4

Sorting Orders in Cainiao Document Fulfillment Center

After a user buys an item on November 11, a corresponding logistics order is created, which is to be processed by Cainiao warehouse and logistics system. The decision making system generates an order fulfillment plan based on the order information so that each stage of warehouse and logistics works with each other smartly. The plan specifies the time for issuing the order to the warehouse, the time for outbound delivery, the time for item collection, and the time for delivering the item. The document fulfillment center carries out each stage of logistics services against the fulfillment plan. Owing to the limited capacities of warehouses and logistics, documents to be processed first are orders considered to be of the highest priorities. Therefore, orders are sorted by priorities before being issued.

ApsaraDB for Redis is used to sort logistics orders and to determine their priorities.

5

To learn more about ApsaraDB for Redis, visit https://www.alibabacloud.com/product/apsaradb-for-redis

For a complete list of best practices on using ApsaraDB for Redis along with sample codes, download the guide here.

1 0 0
Share on

ApsaraDB

377 posts | 57 followers

You may also like

Comments

mosuke5 November 12, 2018 at 2:20 pm

I'm Shinya and I'm working as Alibaba Cloud SA in Japan. I read this post and thought it was good. Can I translate into Japanese and publish our blog site?