If hundreds of millions of people change their WeChat ID, can Tencent handle it?

If hundreds of millions of people change their WeChat ID, can Tencent handle it?

Have you changed your WeChat ID? On June 5, WeChat's official Weibo and public account simultaneously announced that the latest WeChat Android version supports changing WeChat IDs.

As one netizen predicted, the news quickly became a hot topic, and it seems that this function is a pain for many people.

WeChat account is WeChat ID. Even if someone has the same WeChat nickname as you, there is only one WeChat ID. It is like, there are people with the same name as you, but there is absolutely no one with the same ID number as you.

Unlike ID numbers, which are set according to region and date of birth, WeChat IDs can be set at will, so WeChat IDs have become birthday walls, love confession walls, and private spaces representing various meanings: some people use the initials of their exes as WeChat IDs, and some use their birthdays as WeChat IDs. If his current girlfriend asks him what the letters in his WeChat ID mean, the situation will probably be very awkward.


Image | Source: WeChat Pie public account

Therefore, many users have long called on Zhang Xiaolong to quickly launch the function of modifying WeChat ID. However, the iOS version of WeChat has not yet launched this function. In addition, WeChat ID can only be modified once a year. Therefore, even if you want to change it, you have to think carefully before changing it.

For users, changing their WeChat account is just a matter of moving their fingers, but for the WeChat engineers who launched this feature, it is not that simple.

Modifying WeChat account is essentially adding or deleting

Xiao Chi, a Zhihu technology blogger and former Baidu Web service engineer, told DeepTech that when a user modifies an App ID, from the most common perspective, the background needs to perform a deletion operation and an addition operation.

The most common operation on WeChat accounts is not modification but query. In order to optimize the query, there must be an index mechanism (B-tree or Hash table) in the background.

During the add and delete operations, in order to ensure the correctness of the query operations that are performed simultaneously, the data must be locked (some query operations must be paused). This step is also called locking. This step usually uses the Java language and usually requires the use of some middleware, databases, and third-party components.

Three ways to deal with high concurrency

The principle has been figured out. So at present, even if not all Android users need to change their WeChat ID, given the size of WeChat, it is not impossible for millions of users to change their WeChat ID at the same time.

This is where high concurrency comes in. It's easy to understand. For example, when Lu Han announced his relationship, Weibo crashed. This was the result of not handling high concurrency properly. It was National Day, and the Weibo programmer who was supposed to handle the crash had to hold his computer to fix the bug in the middle of the wedding.


Figure | Sina programmers fix bugs at wedding

Therefore, high concurrency means that a large number of users access the same API interface or URL address at the same time. Strictly speaking, if a large number of users modify their WeChat accounts at the same time, there is also a high concurrency risk.

However, it is not difficult to solve. Xiaochi told DeepTech that the first way to deal with high-concurrency writes is usually sharding. For example, after hashing and hashing the WeChat ID (i.e. Hash, hash), storing the WeChat ID in several different database servers according to the different starting numbers can effectively relieve the pressure.

Of course, when doing this, you need to consider the logic of the query operation, that is, query different servers based on the leading digits after hashing and hashing.

In addition, another benefit of sharding is that servers can be dynamically added and removed, thereby minimizing the possibility of downtime.

The second method is to limit the flow of people, just like during the morning rush hour on the subway, staff will hold up small signs and let passengers go in batches. For a large number of users who modify their WeChat accounts at the same time, a message queue can be used to smooth out the peaks. This generally requires cooperation with operations colleagues, such as claiming that it takes 1-2 working days to review the ID modification.

The third method, which is better for user experience, is to prepare more servers. The price of servers is relatively low now, and WeChat can prepare hundreds of servers in advance before publishing the name change announcement.

It is worth noting that most of WeChat’s functions were previously available to iOS users first, because only iPhones use iOS, so it is easier to adapt. Now, some new functions will be available to Android users first. It seems that WeChat is also trying to make things fair. Finally, let me ask you, have you changed your WeChat ID?

<<:  Weibo has a dark mode! Grayscale testing has been enabled and visible to some users

>>:  Should Apple be banned? Academician of the Chinese Academy of Engineering said: The sale of Apple phones should be restricted

Recommend

4 Tips for Analyzing Peers in SEO!

1. Visit the competitor's website as a visito...

The common coconut tree is not the "indigenous" of Hainan.

If you ask what the most common tree in Hainan is...

There is a lot to watch? Can Weijing grab a share of the smart TV industry?

Starting with traditional TV manufacturers such a...

How to promote an app without any budget?

This article is compiled from Zhihu: Zhihu user: ...

【Operational Methodology】Strategies of Cold Start and High Growth

Note: The content comes from NetEase Cloud Classr...

Love Course: e-book collection PDF Baidu network disk download

Love Course: e-book collection PDF Baidu network ...