Original link: http://afoo.me/posts/2022-09-06-he-suan-ma.html
Nucleic acid code system dismantling and design deduction – Teacher Fuqiang said: thinking and precipitation of an architect
Nucleic acid code system disassembly and design deduction
Wang Fuqiang
2022-09-06
On September 2, 2022, when Chengdu was doing large-scale nucleic acid testing, the nucleic acid code collapsed, causing many front-line staff to hold their “feet” in anticipation (picture from the Internet):
It’s not surprising that this kind of scene appears, because all the staff think that there is a problem with the signal of the mobile phone or terminal, and maybe they can get a better signal by raising the height, so it is not surprising that such a scene appears.
But why does everyone think it’s a bad signal? Because of industry practice, when the client (that is, the mobile terminal) sends a request to the back-end server, but fails to receive a response, for product experience or an explanation to the user, the client is often just after the timeout. Prompt the user that the network is not good, so it will lead everyone to think that the network is not good, and it may be better to hold high.
But this is just the appearance. If everyone only looks at the appearance, then it is not surprising that Neusoft is taking the blame to the Internet, but we are technical people, we are technical people, we are professional, so it would be ridiculous to see this. , since we can see the essence through these appearances.
Nucleic acid code, according to President Bo (Wang Xiaobo) of the same city, is actually two systems of nucleic acid and code.
Before everyone wants to do nucleic acid, the QR code opened through the applet is a “code” system. The focus of this system is on reading. Therefore, when the nucleic acid code in some places cannot be opened (actually, the pressure is too great and collapsed). ), the idea of optimization is often to optimize the idea of ”reading”, such as adding cache, such as adding CDN, such as adding image compression, and so on.
The APP installed in the mobile phone or terminal held by the staff is called the “nucleic acid” system. The key point of this system is to write. After scanning the code, the information of your nucleic acid code should be written into the system, and then bound to the reagent relationship. Give it to the testing agency. After the testing is completed, the testing agency will update the test results and your nucleic acid code information to a unified state for storage, so that individuals can see the latest nucleic acid test results after opening the nucleic acid code on their mobile phones ( green, yellow, red).
The wall teacher did not participate in the construction of this system, so many details are not clear, but the general process of deduction is based on observation of the scene.
With this premise, we continue to disassemble why the nucleic acid system does not respond in circles.
The first thing is to understand the HTTP protocol, because almost all APPs now use this protocol to communicate with the server side. Of course, you don’t need to understand it too deeply, as long as you understand the basic characteristics of HTTP A请求-响应
interaction protocol, as if I call you, you reply to me. The problem here is that after I called you, you didn’t call me back, so why didn’t you hear it? Or do you hear it but don’t answer me?
In fact, the nucleic acid system is also a truth. Is the server side not receiving the request? Or received a request and couldn’t reply?
If the request is not received, there is a 99% probability that it is a network problem, which is definitely not running.
If the request is received but cannot be replied, it has nothing to do with the network, the problem lies on the server side.
But in either case, as we said earlier, the APP client will tell the user that “the network is not good”, so many people really think that the network is not good.
But when you can swipe Douyin and use WeChat again, only the nucleic acid code is “bad on the Internet”, which is unreasonable, because there is only one road (the Internet), others can go out and come back, but you can’t, the problem, It is definitely not a matter of the road, but a matter of your server side.
The server side is most likely to be unable to process due to a large number of requests, thus being paralyzed and unable to send responses to each requesting client, resulting in a timeout. hint.
In fact, it is rumored that the nucleic acid code system designed by Neusoft uses a table to carry all data storage and processing. It is very likely to be true, because the concurrency bottleneck of a single table is obvious, and it is a little bit of common sense of architecture and Internet business experience. No one can make such a stupid design.
If there are defects in the design from the beginning, it will be difficult to fix it later. Although it can be difficult, for example, do a full-link stress test before going online. If you find any problems or bottlenecks, you can improve which link. This is also possible, but unfortunately Neusoft doesn’t seem to have done any of these, or it doesn’t even know there is a tool like full-link stress testing!
Finally, let’s summarize:
After working in the system for decades, I can firmly grasp two key factors, namely reading and writing. By grasping both, the basic system design can be greatly simplified.
If there is no control in design, then engineering capabilities should be used to make up for it. For example, tools such as full-link stress testing can be used to find and solve problems one by one through engineering practices and tools.
Of course, it is best if design and engineering can be reasonably matched.
This article is reprinted from: http://afoo.me/posts/2022-09-06-he-suan-ma.html
This site is for inclusion only, and the copyright belongs to the original author.