# 分布式计算

在分布式计算中，系统的各个部分分散在网络连接的计算机上，通过交换消息来相互通信并协调各自的行为。<sup>[1](https://www.govinfo.gov/content/pkg/GOVPUB-C13-520c637fe2cf1083b55b890a92c68ff9/pdf/GOVPUB-C13-520c637fe2cf1083b55b890a92c68ff9.pdf)</sup> 不是由一台机器持有程序和数据，而是由分布在网络上的独立节点分担工作、交换信息、协作得出共同结果。该领域涵盖此类系统的设计、让不可靠组件可靠运行的算法，以及约束任何分布式系统能提供何种保证的各种权衡。

| 关键事实 | 详情 |
|---|---|
| 定义 | 联网计算机上的组件通过传递消息来通信并协调行为。<sup>[1](https://www.govinfo.gov/content/pkg/GOVPUB-C13-520c637fe2cf1083b55b890a92c68ff9/pdf/GOVPUB-C13-520c637fe2cf1083b55b890a92c68ff9.pdf)</sup> |
| 首个大型网络 | ARPANET 起步时只有四个计算机节点；1969年10月29日，第一份计算机之间的信号在加州大学洛杉矶分校与斯坦福研究所之间发送。<sup>[2](https://www.darpa.mil/news/features/arpanet)</sup> |
| 共识极限 | FLP不可能性结果指出，在异步情形下，没有任何确定性算法能保证解决共识问题。<sup>[3](https://academic.oup.com/book/33557/chapter-abstract/287953654)</sup> |
| 拜占庭容错 | 在拜占庭容错共识机制中，要容忍 f 个叛徒达成一致决策，至少需要 3f + 1 个参与者。<sup>[4](https://www.mdpi.com/2227-7390/11/10/2248)</sup> |
| 数据并行处理 | 一次典型的 MapReduce 计算在数千台机器上处理数 TB 数据；谷歌每天运行超过一千个 MapReduce 作业。<sup>[5](https://research.google/pubs/mapreduce-simplified-data-processing-on-large-clusters/)</sup> |
| 科学网格 | 全球大型强子对撞机计算网格汇集了42个国家170多个站点约140万个计算核心和1.5 EB存储，服务超过12000名物理学家。<sup>[6](https://home.web.cern.ch/science/computing/grid/)</sup> |
| 核心权衡 | 网络分区期间，系统必须在可用性与一致性之间权衡；否则，权衡存在于延迟与一致性之间，这一思想在CAP与PACELC定理中被形式化。<sup>[7](https://arxiv.org/abs/1509.05393)</sup><sup> • </sup><sup>[8](https://docs.aws.amazon.com/prescriptive-guidance/latest/resilience-analysis-framework/tradeoffs.html)</sup><sup> • </sup><sup>[27](https://uwaterloo.ca/distributed-algorithms-systems-lab/sites/default/files/uploads/files/proving_pacelc.pdf)</sup> |

## 网络计算的起源

分布式计算的实践基础是ARPANET，这是第一个分布式计算机网络，建立于1969年。<sup>[9](https://www.dougengelbart.org/content/view/334/158/)</sup> 关于网络能在节点故障中存活的想法，来自[兰德公司](https://www.edgepedia.org/zh/rand-corporation)科学家保罗·巴兰（Paul Baran）和莎拉·博姆（Sharla Boehm）1964年的一份备忘录，他们提出了一种采用“烫手山芋”交换的“分布式网络”，使任何单一节点都不会对系统运行至关重要；他们在Fortran中模拟的消息拆分过程后来被称为分组交换。<sup>[10](https://www.livescience.com/technology/communications/science-history-first-computer-to-computer-message-lays-the-foundation-for-the-internet-but-it-crashes-halfway-through-oct-29-1969)</sup> DARPA的动机包括即使在单个节点失效时也能维持通信，因为传统的电路电话设计会让一个节点故障拖垮整个网络。<sup>[2](https://www.darpa.mil/news/features/arpanet)</sup>

第一次传输发生在1969年10月29日晚10:30，原计划是从加州大学洛杉矶分校研究生查理·克莱恩（Charley Kline）向SRI的系统工程师比尔·杜瓦尔（Bill Duvall）发送“login”一词，但系统在发送两个字母后崩溃，因为斯坦福的计算机期望每秒10个字符的数据，而ARPANET运行在每秒5000个字符。<sup>[10](https://www.livescience.com/technology/communications/science-history-first-computer-to-computer-message-lays-the-foundation-for-the-internet-but-it-crashes-halfway-through-oct-29-1969)</sup> 到1970年初，该网络连接了加州大学洛杉矶分校、SRI、加州大学圣巴巴拉分校和[犹他大学](https://www.edgepedia.org/zh/university-of-utah)；到1972年已有37个节点。<sup>[11](https://computerhistory.org/press-releases/museum-celebrates-arpanet-anniversary/)</sup> 主机/主机协议（Host/Host Protocol）从1972年1月起作为该网络的官方协议，直到1983年1月切换至TCP/IP。<sup>[12](https://datatracker.ietf.org/doc/html/rfc6529)</sup> 1983年1月1日，ARPANET在所有主机上从网络控制程序切换至TCP/IP，创建了后来成为互联网基础的网际互联协议。<sup>[13](https://www.tomshardware.com/networking/arpanet-standardized-tcp-ip-on-this-day-in-1983-43-year-old-standard-set-the-foundations-for-todays-internet)</sup>

## 共识及其局限

分布式计算的核心问题是共识，即在故障和异步面前达成一致的能力，这是从不可靠组件构建可靠系统的基本原语。<sup>[14](https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-935.html)</sup> 以Fisher、Lynch和Paterson命名的FLP不可能性结果指出，在异步情形下，没有任何确定性算法能保证解决共识。<sup>[3](https://academic.oup.com/book/33557/chapter-abstract/287953654)</sup> 实践中，系统通过确保有足够多健康副本和网络连通性，使大多数时候进展可靠，并配合随机化退避防止重试引发级联效应，从而力求在有界时间内达成共识。<sup>[15](https://sre.google/sre-book/managing-critical-state/)</sup>

若干共识算法针对这一问题。最初的解决方案是[莱斯利·兰波特](https://www.edgepedia.org/zh/leslie-lamport)（Leslie Lamport）的Paxos协议，替代方案包括Raft、Zab和Mencius。<sup>[15](https://sre.google/sre-book/managing-critical-state/)</sup> 对于存在任意故障（包括恶意故障）的环境，拜占庭容错（BFT）算法提供安全性和活性保证，一个基础性结果是：容忍 f 个叛徒至少需要 3f + 1 个参与者。<sup>[4](https://www.mdpi.com/2227-7390/11/10/2248)</sup><sup> • </sup><sup>[16](https://arxiv.org/abs/2204.03181)</sup>

## CAP定理及其批评

[埃里克·布鲁尔](https://www.edgepedia.org/zh/eric-brewer-computer-scientist)（Eric Brewer）的CAP定理是分布式数据库理论中被引用最多的结果之一，指出一致性、可用性与分区容忍之间的张力。<sup>[17](https://www.mdpi.com/1999-5903/17/4/157)</sup> 它在NoSQL分布式数据库中常被引用，常被解读为最终一致性数据库比强一致性数据库具有更好可用性的证明。分布式系统研究者[马丁·克莱普曼](https://www.edgepedia.org/zh/martin-kleppmann)（Martin Kleppmann）在2015年的一篇批评中梳理了围绕CAP的混乱，发现其定义存在不一致和模糊之处、形式化存在问题，并得出结论：这些问题使人怀疑CAP在推理实际系统权衡方面的效用；他提出了一种“延迟敏感性”框架，转而分析操作延迟如何响应网络延迟。<sup>[7](https://arxiv.org/abs/1509.05393)</sup>

一个相关的表述是PACELC定理，它将权衡扩展到分区之外：它指出系统分区时存在可用性与一致性之间的权衡，否则存在一致性与延迟之间的权衡。<sup>[8](https://docs.aws.amazon.com/prescriptive-guidance/latest/resilience-analysis-framework/tradeoffs.html)</sup><sup> • </sup><sup>[27](https://uwaterloo.ca/distributed-algorithms-systems-lab/sites/default/files/uploads/files/proving_pacelc.pdf)</sup> 在复制数据库中，一致性意味着保证所有客户端同时观察到相同数据，研究者提出了协调副本的一致性控制算法和法定人数协议。<sup>[18](https://nti.khai.edu/ojs/index.php/reks/article/view/reks.2023.2.14/0)</sup>

## 大规模数据处理与存储

**数据并行编程。** [MapReduce](https://www.edgepedia.org/zh/mapreduce)由谷歌的杰弗里·迪恩（Jeffrey Dean）和桑杰·格玛沃特（Sanjay Ghemawat）于2004年发表，是一种编程模型：用户指定一个处理键/值对的map函数和一个合并具有相同键的中间值的reduce函数。以这种方式编写的程序自动在大型商用机器集群上并行化，运行时系统处理分区、调度、故障处理和机器间通信。一次典型计算在数千台机器上处理数TB数据，该模型让没有并行系统经验的程序员也能使用大型集群。<sup>[5](https://research.google/pubs/mapreduce-simplified-data-processing-on-large-clusters/)</sup>

**分布式文件系统。** Hadoop分布式文件系统（HDFS）运行在商用硬件上，高度容错，面向大数据集和高吞吐量而非低延迟设计。它采用主/从架构，单个NameNode管理命名空间，DataNode存储块；文件一次写入（追加和截断除外），块为容错而复制，硬件故障被视为常态而非例外，故障检测和快速自动恢复是核心架构目标。<sup>[19](https://hadoop.apache.org/docs/r2.10.2/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html)</sup>

**科学网格。** 全球大型强子对撞机计算网格（WLCG）为存储、分发和分析大型强子对撞机数据提供全球计算资源。它依托42个国家170多个站点，汇集约140万个计算核心和1.5 EB存储，每天处理超过200万个任务，并在[大型强子对撞机](https://www.edgepedia.org/zh/large-hadron-collider)第二次长期停机结束时维持全球数据传输速率超过260 GB/s；约20%的资源来自CERN。<sup>[6](https://home.web.cern.ch/science/computing/grid/)</sup> 仅CMS实验在峰值性能下每年就产生超过5 PB数据。数据流经层级结构：CERN的Tier 0重建完整碰撞事件，位于法国、德国、意大利、西班牙、台湾、英国和美国的七个Tier 1中心用精细校准重新重建事件，约40个Tier 2设施处理具体分析任务。<sup>[20](https://cmsexperiment.web.cern.ch/detector/computing-grid)</sup> WLCG于2025年12月迎来运行二十周年，已成为大规模科学协作的典范，其资源还用于天文学、天体粒子物理、引力波研究，并在新冠疫情期间用于蛋白质折叠研究。<sup>[21](https://home.cern/celebrating-two-decades-global-scientific-computing/)</sup>

## 架构模式及其代价

现代应用架构本身就是分布式系统。在微服务架构中，每个组件都是通过网络（通常是HTTP）通信的独立服务，配有专门的运行时基础设施，支持每个服务的独立开发、交付和运营。<sup>[22](https://docs.aws.amazon.com/prescriptive-guidance/latest/micro-frontends-aws/micro-frontend-alternatives.html)</sup> 代价是具体的：分布式计算架构使满足用户延迟要求更加困难，增加调试和追踪的复杂性，并随着受管应用数量增长而增加运营负担。一个著名的反模式是“微服务死星”，当组件相互依赖过深以致一个故障引发级联时，系统会变得像单体一样僵化脆弱。<sup>[23](https://docs.aws.amazon.com/wellarchitected/2022-03-31/framework/rel_service_architecture_monolith_soa_microservice.html)</sup> 分布式系统还面临延迟、网络中断、数据丢失、扩展和[数据复制](https://www.edgepedia.org/zh/data-replication)滞后等反复出现的挑战，同步通信造成时间耦合，即工作负载及其依赖必须同时可用。<sup>[24](https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/rel_prevent_interaction_failure_identify.html)</sup>

## 当前方向

该领域的重心一直在沿边云连续体转移，即去中心化的边缘资源与集中式云基础设施协同运行：云为训练AI模型提供大规模算力，边缘节点则在最终用户附近支持推理和时间敏感型应用，降低延迟以及向远处设施传输大量数据的需求。<sup>[25](https://eur-lex.europa.eu/legal-content/EN/TXT/?qid=1786336641635&uri=CELEX%3A52026DC0288)</sup> 边云协同计算的综述指出了正在进行的研究方向，包括大语言模型部署、6G集成以及跨网络的异构性管理。<sup>[26](https://arxiv.org/abs/2505.01821)</sup> 与此同时，几十年前确定的理论约束仍然有效：完全异步系统中的共识无法确定性保证，每个设计仍在协商一致性、可用性和延迟之间的平衡。<sup>[3](https://academic.oup.com/book/33557/chapter-abstract/287953654)</sup><sup> • </sup><sup>[8](https://docs.aws.amazon.com/prescriptive-guidance/latest/resilience-analysis-framework/tradeoffs.html)</sup>

## References

1. [NIST Big Data Interoperability Framework: Volume 1, Definitions](https://www.govinfo.gov/content/pkg/GOVPUB-C13-520c637fe2cf1083b55b890a92c68ff9/pdf/GOVPUB-C13-520c637fe2cf1083b55b890a92c68ff9.pdf)
2. [ARPANET, DARPA](https://www.darpa.mil/news/features/arpanet)
3. [Distributed Systems: Cryptographic Primitives in Blockchain Technology, Oxford Academic](https://academic.oup.com/book/33557/chapter-abstract/287953654)
4. [A Systematic Review of Consensus Mechanisms in Blockchain, MDPI Mathematics](https://www.mdpi.com/2227-7390/11/10/2248)
5. [MapReduce: Simplified Data Processing on Large Clusters, Google Research](https://research.google/pubs/mapreduce-simplified-data-processing-on-large-clusters/)
6. [The Worldwide LHC Computing Grid (WLCG), CERN](https://home.web.cern.ch/science/computing/grid/)
7. [A Critique of the CAP Theorem, Martin Kleppmann, arXiv](https://arxiv.org/abs/1509.05393)
8. [Understanding trade-offs and risks, AWS Prescriptive Guidance](https://docs.aws.amazon.com/prescriptive-guidance/latest/resilience-analysis-framework/tradeoffs.html)
9. [Pre-IS Engelbart's Role in Internet/ARPANET History, Doug Engelbart Institute](https://www.dougengelbart.org/content/view/334/158/)
10. [Science history: First computer-to-computer message, Live Science](https://www.livescience.com/technology/communications/science-history-first-computer-to-computer-message-lays-the-foundation-for-the-internet-but-it-crashes-halfway-through-oct-29-1969)
11. [Celebrating the 40th Anniversary of First ARPANET Transmission, Computer History Museum](https://computerhistory.org/press-releases/museum-celebrates-arpanet-anniversary/)
12. [RFC 6529: Host/Host Protocol for the ARPA Network, IETF](https://datatracker.ietf.org/doc/html/rfc6529)
13. [ARPANET standardized TCP/IP on this day in 1983, Tom's Hardware](https://www.tomshardware.com/networking/arpanet-standardized-tcp-ip-on-this-day-in-1983-43-year-old-standard-set-the-foundations-for-todays-internet)
14. [UCAM-CL-TR-935, University of Cambridge Computer Laboratory](https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-935.html)
15. [Distributed Consensus algorithms and CAP Theorem, Google SRE Book](https://sre.google/sre-book/managing-critical-state/)
16. [Reaching Consensus in the Byzantine Empire: A Comprehensive Review of BFT Consensus Algorithms, arXiv](https://arxiv.org/abs/2204.03181)
17. [The New CAP Theorem on Blockchain Consensus Systems, MDPI Future Internet](https://www.mdpi.com/1999-5903/17/4/157)
18. [Consistency issue and related trade-offs in distributed replicated systems and databases, Radioelectronic and Computer Systems](https://nti.khai.edu/ojs/index.php/reks/article/view/reks.2023.2.14/0)
19. [Apache Hadoop 2.10.2 HDFS Architecture](https://hadoop.apache.org/docs/r2.10.2/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html)
20. [Computing Grid, CMS Experiment, CERN](https://cmsexperiment.web.cern.ch/detector/computing-grid)
21. [Celebrating two decades of global scientific computing, CERN](https://home.cern/celebrating-two-decades-global-scientific-computing/)
22. [Comparing micro-frontends with alternative architectures, AWS Prescriptive Guidance](https://docs.aws.amazon.com/prescriptive-guidance/latest/micro-frontends-aws/micro-frontend-alternatives.html)
23. [REL03-BP01 Choose how to segment your workload, AWS Well-Architected Framework](https://docs.aws.amazon.com/wellarchitected/2022-03-31/framework/rel_service_architecture_monolith_soa_microservice.html)
24. [REL04-BP01 Identify the kind of distributed systems you depend on, AWS Well-Architected Framework](https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/rel_prevent_interaction_failure_identify.html)
25. [EUR-Lex CELEX 52026DC0288 on edge computing](https://eur-lex.europa.eu/legal-content/EN/TXT/?qid=1786336641635&uri=CELEX%3A52026DC0288)
26. [Edge-Cloud Collaborative Computing on Distributed Intelligence and Model Optimization: A Survey, arXiv](https://arxiv.org/abs/2505.01821)
27. [uwaterloo.ca](https://uwaterloo.ca/distributed-algorithms-systems-lab/sites/default/files/uploads/files/proving_pacelc.pdf)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Algorithms and computational methods › Algorithms overview

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/distributed-computing

English original: https://www.edgepedia.org/distributed-computing
