Common Patterns in Distributed System Design
Previously, I translated an article about distributed systems (https://lichuanyang.top/posts/3914/) which received positive feedback across various platforms. So I recently reorganized the related knowledge, combined with new insights gained over the past year, and rewrote this article. First, let’s clarify what kind of distributed systems we’re discussing here. Simply put, they need to satisfy two conditions: multi-node and stateful. Multi-node is straightforward to understand. Being state...
Are High-Concurrency Solutions Really That Hard? A Casual Guide to High-Concurrency Design
Does high request concurrency always lead to high-concurrency problems? Not necessarily. Imagine an application that does nothing but in-memory computation — no matter how high the request volume, you could simply add more machines to scale linearly. There would be no “high-concurrency problem” to speak of. High-concurrency problems exist because the system has a single-point bottleneck that can’t be solved by brute-force scaling. And in over 90% of cases, that bottleneck is the database. T...
What Are SSP, DSP, RTB, and ADX? Understanding the Concepts and Evolution of Internet Advertising
In this article, I will introduce the current state of internet advertising and untangle the underlying logic of internet advertising, to help everyone better understand this industry. What Is AdvertisingWhen discussing internet advertising, we must first start with what advertising itself is. Only by understanding the underlying logic of advertising can we better understand what problems exist in internet advertising, why programmatic advertising trading emerged, why various systems like A...
From Redo Log and Undo Log to Isolation Levels: A Deep Dive into Database Transactions and ACID
Recently, I read Zhou Zhiming’s book “Phoenix Architecture” and gained deeper insights into many aspects of technology. I plan to make some summaries. Today, I’ll start with the section on transactions, combining content from the book with my own understanding, aiming to explain local transactions clearly and thoroughly. If there are any inaccuracies, I welcome corrections. A transaction ensures that data in the database remains in a valid state. Through continuous CRUD operations, the data...
Practical experience using kubernetes in java projects with low learning costs
Compared with large manufacturers, many start-up companies have a very important disadvantage that their infrastructure is imperfect and they do not have a variety of complete tools. Therefore, I plan to sort out how to build a development process with a good experience based on the capabilities provided by the open source community with as little operation and maintenance and development costs as possible. First, let’s sort out the necessary steps in the entire development process. I will ...
2021 in Upheaval — A Mid-Career Engineer's Year-End Review
2021 was a year of upheaval for me personally. A job I had planned to pursue long-term — one with excellent comfort and promising prospects — suddenly collapsed due to certain reasons. Consequently, I faced a critical crossroads regarding my future direction. At least so far, I feel I’ve made some correct choices. I’ve also made good progress on the personal growth goals I set at the beginning of the year. So I’m approaching this year-end review with a reasonably positive mindset. Career Re...
A Canary Release Approach in Kubernetes
Canary release is actually a process well-suited for cloud-native environments, so I believe many people have the need to perform canary releases under Kubernetes. In this article, we introduce a very simple approach to canary release. What is Canary ReleaseFirst, let me introduce what a canary release is. The name “canary” originates from the fact that miners discovered canaries are very sensitive to gas. Before descending into the mine, miners would send a canary down first. If the canary...
Prometheus Tutorial: Everything You Need to Know
As the “default” monitoring system in the cloud-native ecosystem, Prometheus is gaining increasing attention. Today, we’ll write a tutorial about Prometheus’s design philosophy, examining how it uses very simple designs to support such complex functionality. First, let’s think about what the challenges would be in building a monitoring system similar to Prometheus: Each service has different monitoring requirements. How should a monitoring system design its data model to balance ease of us...
Building a Simple High-Performance Java IP Address Country Lookup Tool
A high-performance Java IP address-to-country lookup tool. The core approach uses binary search over a pre-loaded array of IP ranges, achieving microsecond-level latency per query. Design ThinkingAn IP address is essentially a 32-bit integer. An “IP range” is simply a continuous range of integers. Given an IP, we need to find which range it falls into — a classic interval search problem. The most direct approach is to iterate through all IP ranges — O(n) complexity. But there are hundreds o...
Configuring SSH Bookmarks in iTerm2 for Password Storage and Auto Login
Pain Point: Frequent SSH LoginsIf you’re like me and frequently need to access different remote servers, recording server IPs and entering passwords can be very tedious. Fortunately, by making some configurations in iTerm2, this pain point can be well addressed. The final result is similar to configuring SSH bookmarks, enabling iTerm2 to remember SSH passwords and achieve passwordless and automatic login. Complete Configuration StepsiTerm2 (https://iterm2.com/) is a widely used terminal alt...















