系统设计完整指南: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 有比较完整的展开,想往资料层深入可以从那里接续。