Terry Cheng
@terrychengtw
Taipei · UTC+8
主題Theme
語言Lang
按 D 切換主題 · L 切換語言press D for theme · L for language
← 回首頁 ← Back to index
2025·08·10 隨筆 Essay 8 min · go

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

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

草稿。

什麼時候 ORM 還是對的

  • CRUD-shaped 功能(就是列表 + 表單)
  • 團隊新手多、pattern 比效能重要
  • 原型階段

什麼時候我選 hand-written SQL

  • 報表類——joins、CTE、window
  • 高 throughput 的 hot path
  • 需要 plan 穩定的地方
一次寫一點 慢慢累積 one thought at a time slowly