Moonglade

Modern Markdown blogging with AI-powered localization and search.

All Posts




How does WeChat implement distributed message distribution in its architecture? ★

This article provides an in-depth analysis of WeChat's seemingly counterintuitive feature designs, such as QR code login, lack of synchronization across multiple devices, and the inability to check whether a user has been blocked. It argues that these are not product experience flaws but rather inevitable outcomes of a distributed architecture. By observing the low-latency communication experienced by users in Australia, the author infers that WeChat employs globally distributed server nodes rather than centralized data centers. To achieve this, WeChat relies on three core algorithms: server selection, server-side switching, and user discovery. It also extensively utilizes the Gossip protocol to achieve decentralized state consistency and message routing. This architecture enables WeChat to scale flexibly like communication base stations, deploying resources where demand is highest, thereby significantly enhancing stability and operational efficiency under high concurrency while avoiding single points of failure. The article also explains mechanisms such as group chats and file transfer, drawing analogies to Email protocols to reveal WeChat's essence as a global communication infrastructure. Finally, the author urges product managers to understand the complexity of underlying architectures, avoid blind imitation or underestimating technical constraints, because simple-looking features often conceal sophisticated system design logic.

Views 3,653
Distributed Distributed Systems IM Messging WeChat Web



Why Should the Software Customization Industry Develop a Software Subscription Model?

This article highlights the widespread challenges faced by domestic public institutions and non-internet enterprises in China, including poor software quality, numerous vulnerabilities, and a lack of ongoing maintenance. The root cause lies in the perpetual license procurement model, which weakens the vendor's responsibility after delivery, leading to significant technical debt. The article advocates for a shift toward software subscription models (SaaS), where usage rights and services are purchased based on time and volume, rather than acquiring source code through a one-time purchase. A case study comparing a university's academic administration system demonstrates that the subscription model ensures 99% system availability, with the vendor's professional team responsible for monitoring, iteration, and bug fixes, thereby completely relieving the client of operational burdens and risks. From a cost perspective, although annual fees for subscriptions may appear higher, this model avoids the substantial losses and additional labor costs associated with software defects under the perpetual license model. Furthermore, service providers are incentivized to retain customers by adopting advanced technologies such as DevOps to reduce marginal costs. Additionally, flexible pricing based on daily or per-user usage lowers the barrier to trial for clients, as evidenced by the successful transition of Microsoft Office 365. Despite concerns regarding data localization and asset reporting, the subscription model is becoming the mainstream direction for improving overall IT service quality due to its clear division of responsibilities, high service quality, and alignment with future industry trends.

Views 459
China DevOps SaaS Software Development Software Subscription Subscription

Is hashing passwords on the frontend a good approach?

This article uses a riddle about password hashing to reveal the limitations of front-end hashing in security mechanisms. It points out that if data is only hashed on the front end before transmission, the server effectively degrades to plain-text comparison. This allows operations personnel to use the hash value directly to call the API and log in, thereby negating the purpose of security protections. The author reviews the historical practice of early Tencent QQ, which used two-pass hashing to prevent man-in-the-middle attacks, and explains why this scheme failed due to vulnerability to replay attacks. True defense against man-in-the-middle attacks relies on TLS encryption. Drawing from personal experience, the author describes how, during the era of rampant ARP spoofing, plaintext protocols like email were easily attacked, while modern TLS handshake mechanisms have significantly improved communication security. Finally, the article emphasizes that technical measures are not a panacea. Social engineering attacks, such as browser plugin abuse and phishing sites, remain a significant threat. Enhancing users' security awareness and basic judgment skills is the fundamental solution.

Views 618
Hash Password Security hashing algorithm manual in the middle attack password security