Understanding Distributed Theory and Algorithms: Importance, Core Concepts, and Learning Path
This article explains why distributed theory and algorithms are crucial for architects, outlines the four foundational theories and eight key protocols, discusses their four evaluation dimensions, and provides a step‑by‑step learning roadmap illustrated with stories and practical examples.
This article introduces the significance of distributed theory and algorithms, emphasizing their essential role in high‑level architecture interviews and long‑term career development.
Importance
It addresses common questions such as CAP theorem, Zookeeper leader election, and fault tolerance, highlighting that mastering these concepts boosts core competitiveness.
Is it easy to learn?
Many developers know the basics of CAP and BASE but rarely dive deep into algorithms due to three reasons: perceived complexity, lack of plain‑language resources, and absence of a clear learning path.
Four Foundational Theories
Byzantine Generals Problem
CAP Theory
ACID Theory
BASE Theory
Eight Distributed Protocols and Algorithms
Paxos Algorithm
Raft Algorithm
Consistent Hashing
Gossip Protocol
Quorum NWR Algorithm
FBFT Algorithm
POW Algorithm
ZAB Protocol
How to Learn Efficiently
Choosing the right algorithm for a given scenario requires understanding each algorithm’s trade‑offs between consistency, availability, performance, and fault tolerance.
Four Evaluation Dimensions
The dimensions are Byzantine fault tolerance, consistency, performance, and availability.
Byzantine Fault Tolerance
Describes the untrusted environment model from the Byzantine Generals Problem, distinguishing between Byzantine fault tolerance and non‑Byzantine (fault) tolerance.
Non‑Byzantine algorithms include 2PC, TCC, Paxos, Raft, Gossip, Quorum NWR, and ZAB.
Byzantine algorithms include POW and FBFT.
Consistency
Strong consistency – reads always see the latest write.
Weak consistency – no guarantee that reads see the latest write.
Eventual consistency – reads eventually converge to the latest value.
Strong consistency is often achieved with 2PC or Raft; eventual consistency with Gossip and Quorum NWR; ZAB provides eventual consistency optimized for read performance.
Availability
Availability means the system can respond, though not necessarily with the freshest data. Gossip offers the highest availability, followed by Paxos/Raft/ZAB/Quorum NWR/FBFT/POW, while 2PC and TCC have the lowest.
Performance
Performance correlates with availability; higher availability generally yields better performance. Gossip excels in AP‑type systems, while consensus‑based algorithms have moderate performance, and 2PC/TCC are the slowest.
Learning Roadmap
Lecture 1: Byzantine Generals Problem
Explained using the four roles in the card game "Three Kingdoms Kill".
Lecture 2: CAP, BASE, ACID Theories
Uses 刚 (rigid) and 柔 (flexible) from Tai Chi to illustrate ACID vs. BASE, with CAP balancing the two.
Lecture 3: Paxos Algorithm
Illustrated with characters Zhuge Liang and Pang Tong acting as 提议者 (proposers).
Lecture 4: Raft Algorithm
Demonstrated with animated GIFs showing the leader election process.
Lecture 5: Consistent Hashing
Explained via the story of Han Xin’s troop deployment.
Lecture 6: Gossip Protocol
Compared to a contagious virus to show how information spreads.
Lecture 7: Quorum NWR
Uses the alchemical furnace of Tai Shang Lao Jun as a metaphor for N, W, R parameters.
Lecture 8: POW Algorithm
Connects blockchain and Bitcoin concepts with the story of Zixia Fairy and Supreme Treasure.
A PDF compilation of the eight lectures (over 20,000 words) is available; reply with the keyword 分布式 to receive it.
Wukong Talks Architecture
Explaining distributed systems and architecture through stories. Author of the "JVM Performance Tuning in Practice" column, open-source author of "Spring Cloud in Practice PassJava", and independently developed a PMP practice quiz mini-program.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.