系統設計完整指南:13 篇帶你從觀念到實戰元件

系統設計不是一門可以靠背誦通過的科目。它考的是:給你一個模糊的需求,你能不能問出對的問題、估出對的規模、選出對的元件,並且說清楚每個選擇的代價。

系統設計學習路徑總覽:12 篇文章的架構圖

系統設計到底在考什麼

多數人準備這個主題時會直接跳到「怎麼設計 Twitter」這類題目,背下一套標準答案。這個做法的問題是,面試官真正在看的不是你畫出什麼,而是你怎麼推導。一個合格的回答通常包含四個動作:釐清需求邊界、估算資料量與流量、提出初版架構、然後主動指出這個架構會在哪裡先壞掉。

這四個動作分別對應不同的基礎能力。釐清需求靠的是對非功能性特性的理解(可用性、一致性、延遲各自的取捨);估算靠的是封底計算;提出架構靠的是對標準元件的熟悉度;指出弱點則靠對分散式系統失效模式的認識。這份指南的 12 篇文章就是按這四條線鋪開的。

這份指南把 hogan.tech 的架構設計系列 13 篇整理成一條完整的學習路徑。從「這套方法到底在解決什麼問題」開始,一路推進到負載平衡、資料庫複製與分區、快取與內容分發,每一篇都可以獨立閱讀,但依序讀會更有脈絡。

這份系統設計指南適合誰

  • 準備這門學問面試、需要在白板上畫出完整架構的工程師
  • 已經會寫功能、但說不清楚「為什麼要這樣拆」的開發者
  • 想補齊分散式系統基礎概念的後端與全端工程師

系統設計學習路徑(13 篇)

建議依序閱讀。01-05 建立觀念與估算能力,06-13 逐一拆解實際元件。

01. 現代架構設計介紹

先建立「這套方法在解什麼問題」的整體視角,是整個系列的地基。

02. 抽象在分散式架構中的應用

抽象化是這門學問的核心工具,理解 RPC/gRPC 如何隱藏複雜度。

03. 軟體設計非功能性特性

可用性、可靠性、延展性這些非功能性需求,才是面試與實務真正的考點。

04. Back-of-the-envelope 封底計算

學會用封底計算快速估算容量與流量,面試現場最常被要求的技能。

05. 這個主題元件介紹 Building Block

認識組成大型系統的標準積木,後面每一篇都在展開其中一塊。

06. DNS 是什麼?網域名稱系統介紹

從網域查詢流程理解分散式快取與階層式架構的經典範例。

07. 負載平衡器解說

流量進入系統的第一道關卡,負載平衡的演算法與健康檢查機制。

08. 資料庫基礎介紹

關聯式與 NoSQL 的選型依據,以及各自適合的資料形態。

09. Data Replication 如何優化資料庫?

資料複製如何同時提升讀取效能與容錯能力,以及一致性的代價。

10. Data Partitioning 資料分區是什麼?

當單一資料庫撐不住時,分區策略怎麼切、熱點怎麼避免。

11. Key-Value Store 鍵值資料儲存解說

鍵值儲存的設計取捨,理解它為什麼是許多系統的基礎元件。

12. CDN 基礎概念與設計

內容分發網路如何把資料推到離使用者最近的地方,降低延遲。

13. 快取策略完整解析

Cache-Aside 到 Write-Behind 五種讀寫模式、六種淘汰演算法,以及快取雪崩、穿透、擊穿的成因與解法。

學完這 13 篇系統設計文章你會具備什麼

  • 看到一個需求,能在三分鐘內估出每秒請求數、儲存量與頻寬需求
  • 知道什麼時候該用關聯式資料庫、什麼時候該換成鍵值儲存
  • 能解釋資料複製為什麼會帶來一致性問題,以及各種折衷方案的代價
  • 理解快取、負載平衡、CDN 各自解決的是哪一層的瓶頸,不會把它們混為一談

延伸資源

這份系統設計指南聚焦在觀念建立與中文解釋。想補英文原始資料,以下幾個來源值得一看:

英文術語對照表

多數系統設計的第一手資料是英文。下面整理這系列出現的核心術語與對應中文,方便你延伸搜尋英文資源。

  • Availability(可用性)— the proportion of time a system remains operational and able to serve requests.
  • Consistency(一致性)— whether all nodes return the same data at the same time after a write.
  • Latency(延遲)— the time taken for a single request to travel from client to server and back.
  • Throughput(吞吐量)— the number of requests a system can process within a given time window.
  • Back-of-the-envelope estimation(封底計算)— rough capacity math done quickly to sanity check a design before building it.
  • Load Balancer(負載平衡器)— a component that distributes incoming traffic across multiple backend servers.
  • Replication(資料複製)— keeping copies of the same data on multiple machines for durability and read performance.
  • Partitioning / Sharding(資料分區)— splitting a dataset across machines so no single node holds everything.
  • Key-Value Store(鍵值儲存)— a database that maps unique keys directly to values, optimised for fast lookups.
  • Content Delivery Network(內容分發網路)— geographically distributed servers that cache content close to end users.
  • Building Block(基礎元件)— a reusable standard component that appears across many different architectures.
  • Non-functional Requirements(非功能性需求)— constraints such as availability, scalability and security rather than features.

If you are preparing for interviews conducted in English, practise explaining each of these concepts out loud in one or two sentences. Being able to name the trade-off behind every component matters far more than memorising a reference architecture.

Frequently Asked Questions

How long does it take to work through this system design series?

Most readers finish the twelve articles in two to three weeks reading one every other day. If you are preparing for an interview with a fixed date, prioritise articles one, three and four first, because requirement clarification and capacity estimation are what interviewers probe in the opening ten minutes of almost every session.

Do I need backend experience before starting?

No. The series assumes you can read code and have built at least one web application, but it does not assume you have operated a distributed system in production. Every component article explains the problem before introducing the solution, so you can follow along without prior infrastructure experience.

Why does this series spend four articles on databases?

Because data is where most real architectures actually break. Stateless application servers scale almost trivially by adding machines. The database layer is where replication lag, partition key selection and consistency guarantees force genuine trade-offs, and those trade-offs are exactly what separates a shallow answer from a convincing one.

Is memorising reference architectures useful?

Only as a starting vocabulary. Interviewers routinely change constraints halfway through a discussion to see whether you understood the reasoning or simply recalled a diagram. Practise explaining why each component exists and what fails if you remove it.

What should I read after finishing this series?

Pick one production system you already use and trace how it would be designed using the components covered here. Reading engineering blogs from companies operating at scale, such as the resources linked above, turns abstract patterns into concrete decisions you can reason about.

怎麼用這份系統設計指南

如果時間有限,先讀 01、03、04 這三篇——它們決定你能不能在面試裡把問題問對、把規模估對。元件類的文章(06 之後)可以等真的遇到該問題時再回來查。

系列之外,資料庫相關主題在 08-11 有比較完整的展開,想往資料層深入可以從那裡接續。