👋 Hi there!

Sharing thoughts on technology and everyday life — a journey of learning and growth.

Unique Indexes: We Should Think Twice (Especially at Scale)

In “Big Tech” environments (you know, the kind with tons of users, massive datasets, and rapidly evolving requirements), relying on database UNIQUE INDEX constraints to prevent duplicate data—unless it’s for something like financial reconciliation where every penny must be exact—honestly, might not be as effective as you think. Plus, the cost of maintaining them can be surprisingly high. A better approach is often to handle the bulk of deduplication logic at the application layer. If you can avoid using a database unique index, consider doing so, or at least think it through very carefully before implementing one. ...

May 16, 2025 · 8 min · Zhiya

Sheep a Sheep Tech Walkthrough

Recently, “Sheep a Sheep” has become quite popular, but it’s extremely difficult. After playing dozens of rounds over a few days without success, I succumbed to my professional habits and decided to see if there was a technological method to beat it. After finding an effective method, I organized it here to help others achieve a tech-based victory. Principle The principle behind a tech-based victory is quite simple. The game presents two maps each day. The first map is a warm-up and can be completed easily, while the second map is extremely challenging. Therefore, if you can change the second map to be the same as the first, you can achieve victory. ...

September 20, 2022 · 2 min · Zhiya

Practicing Go Project Architecture with Clean Architecture

Over the years, Go has become a widely used programming language across various fields. From foundational components like k8s and Docker to microservices in the business domain, Go can be used to build them all. When constructing these Go projects, the choice of architecture pattern and code layout is subjective. Those with Java Spring experience might opt for the MVC pattern, while those familiar with Python Flask might choose the MTV pattern. Moreover, since there is no mainstream enterprise-level development framework in the Go language domain, many projects lack a clear architectural pattern. ...

December 12, 2021 · 3 min · Zhiya

Pitfalls of Passing Scope Across Services in Python

Background In an old system, there is a piece of code like this: scope = dict(globals(), **locals()) exec( """ global_a = 123 def func_a(): print(global_a) """ , scope) exec("func_a()", scope) The first segment of user code defines a function, and the second segment executes the function (don’t ask why this is done, because the user is always right). After executing the first code block, func_a and global_a are added to the scope. Since the second code block uses the same scope, calling func_a in the second block correctly outputs 123. ...

November 6, 2021 · 4 min · Zhiya

Using AWS Lambda and iOS Shortcuts for One-Tap Access to Community Gates

The residential community where I live uses a smart access control system called “Watchful Domain (守望领域)” which allows opening community and unit gates via a mobile app. However, using the app to open gates involves several steps: open the app → navigate to the gate control interface → find the gate you want to open → tap to open. Moreover, unlocking the phone with a mask on requires entering a password, making the process quite time-consuming. Often, I find myself standing at the community or unit entrance for a while. At one point, I even got into the habit of carrying a physical access card, which is much quicker for opening gates. ...

October 19, 2021 · 8 min · Zhiya