Terry Cheng
@terrychengtw
Taipei · UTC+8
主題Theme
語言Lang
按 D 切換主題 · L 切換語言press D for theme · L for language
§ 02 / WRITING

文章Writing

所有文章,由新到舊。想通的就寫一下,沒想通的就先擱著。

Every post, newest first. I write when something has finally clicked.

10
共 2 年
10 posts
2 years
篩選Filter
2026 4 posts
2025 6 posts
2025·12·14 § 005

Postgres 的 lock 為什麼總是違反我的直覺

Why Postgres locking keeps surprising me

SELECT FOR UPDATE 的鎖範圍不是你想的那樣。一篇關於 row-level lock、advisory lock、與我踩過的三個坑。

SELECT FOR UPDATE doesn't lock what you think. Row-level locks, advisory locks, and three footguns.

深入 Deep dive 14 min · postgres
2025·11·02 § 006

工程師的寫作曲線:從 README 到 blog

The engineer's writing curve

把寫作當肌肉練。從 commit message 到 postmortem 到文章,中間的卡點在哪。

Writing as a practice. From commit messages to postmortems to essays — and where the uncomfortable jumps are.

隨筆 Essay 7 min · meta
2025·10·18 § 007

關於 timeout 的小筆記

A small note on timeouts

最近才想清楚:client timeout、server timeout、context timeout 三者該怎麼配合。

Client, server, and context timeouts — how they actually compose. One diagram, one page.

筆記 Note 4 min · systems
2025·09·05 § 008

一支 query 吃掉我整個週末的故事

The query that ate my weekend

explain analyze 從 300 行讀到 0 行,中間換了三次假設。這是慢 query 修復的完整過程。

Reading explain analyze, going from 300 lines to zero, revising the hypothesis three times. A full slow-query autopsy.

深入 Deep dive 16 min · postgres
2025·08·10 § 009

為什麼我不再用 ORM 寫新功能

Why I stopped reaching for the ORM first

不是 ORM 不好,是 default 選擇太便宜,常常遮掉了資料庫真正在做的事。

ORMs aren't bad — they're just too cheap a default, and the cheap default often hides what the DB is doing.

隨筆 Essay 8 min · go
2025·07·22 § 010

把自己的 server 從 DigitalOcean 搬到 Hetzner

Moving my server from DigitalOcean to Hetzner

一個下午的遷移紀錄,包含一個我忘記備份 DNS 的尷尬時刻。

An afternoon's move, including the awkward moment I forgot to back up DNS.

紀錄 Log 5 min · ops
一次寫一點 慢慢累積 one thought at a time slowly