Please pay attention to your support if you have any help. Thank you for your support and continue to write

Case one: The 100-million-level relationship chain storage of micro Tao community

Weitao community carries the social relationship chain of hundreds of millions of Taobao users. Each user has his or her own attention list, and each business has its own fan information. The relationship chain carried by the whole Weitao community is shown in the figure below.

If the traditional relational database model is used to express the above relational information, the business design will be complicated, and can not get good performance experience. Wetao community uses Redis cluster cache to store the community’s concern chain, which simplifies the storage of concerned information and ensures the silk-smooth experience of double Eleven business.

The micro taobao community uses Hashes to store the concerned information between users. The storage structure is as follows and the following two query interfaces are provided:

  • Whether user A has A concern with user B
  • User A’s active relationship list

Case 2 Tmall live comments product cursor paging

Users of Singles’ Day need to refresh the comments corresponding to the live broadcast when they watch the live broadcast on the wireless terminal, mainly in the following three modes:

  • Incremental drop down: Retrieves a specified number of comments (increments) from a specified position.
  • Drop-down Refresh: Retrieves the latest specified number of comments.
  • Incremental pull-up: Retrieves a specified number of comments (increments) from a specified position.

The wireless live broadcast system uses Redis to optimize the business of this scene, ensuring the success rate of the live broadcast comment interface and ensuring TPS of more than 50,000 and response time requests of millisecond level. The live broadcast system will write two pieces of data for each live broadcast, namely index data and comment data. The index data is the data structure of SortedSet for sorting comments, while the comment data is stored by Hashes. When obtaining comments, the required index ID is obtained through the index and then the list of comments is obtained by reading Hashes. The comment writing process is as follows:

After refreshing the list, the background needs to obtain the corresponding comment information, and the process is as follows:

  • Gets the current index position
  • Get index list
  • Get comment data

Case 3 Order ordering of rookie document fulfillment center

After a transaction order is generated, a logistics order will be generated, which needs to be processed by cainiao warehouse distribution system. In order to make all stages of warehouse distribution work together more intelligently, the decision-making system will specify the corresponding order fulfillment plan according to the order information, including when to send warehouse, when to go out of the warehouse, when to deliver and receive, when to deliver and other information. According to the performance plan, the document fulfillment center shall perform the logistics service for each stage according to the corresponding time. Due to the limited shipping capacity of warehouse and distribution, the earliest documents expected to be operated are those with the highest priority according to the business. Therefore, orders should be sorted according to the priority before they are actually placed and sent to warehouse or distribution.

The fulfillment center uses Redis to sort all logistics orders to determine which order is the highest priority.

Please pay attention to your support if you have any help. Thank you for your support and continue to write