Skip to content

Commit 67c9dc4

Browse files
committed
Add new Mermaid diagrams for consensus algorithms and data consistency models
- Introduced multiple Mermaid diagrams illustrating key concepts in distributed systems, including sequence diagrams for consensus algorithms and flowcharts for data consistency models. - Added diagrams for the Paxos consensus process, Raft leader election, and various consistency models such as linearizability and eventual consistency. - Enhanced documentation clarity and visual representation of complex topics, aiding user understanding and engagement.
1 parent 5590217 commit 67c9dc4

1,741 files changed

Lines changed: 16207 additions & 1656 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.mermaid_validate/b0000.mmd

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
sequenceDiagram
2+
participant P as Proposer
3+
participant A1 as Acceptor 1
4+
participant A2 as Acceptor 2
5+
participant A3 as Acceptor 3
6+
7+
P->>A1: Prepare(n=1)
8+
P->>A2: Prepare(n=1)
9+
P->>A3: Prepare(n=1)
10+
A1-->>P: Promise(n=1, none)
11+
A2-->>P: Promise(n=1, none)
12+
Note over P: Majority promised
13+
P->>A1: Accept(n=1, value=X)
14+
P->>A2: Accept(n=1, value=X)
15+
A1-->>P: Accepted
16+
A2-->>P: Accepted
17+
Note over P: Value X is chosen

.mermaid_validate/b0000.svg

Lines changed: 1 addition & 0 deletions
Loading

.mermaid_validate/b0001.mmd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
stateDiagram-v2
2+
[*] --> Follower
3+
Follower --> Candidate: Election timeout
4+
Candidate --> Leader: Receives majority votes
5+
Candidate --> Follower: Discovers higher term
6+
Leader --> Follower: Discovers higher term
7+
Candidate --> Candidate: Election timeout (split vote)

.mermaid_validate/b0001.svg

Lines changed: 1 addition & 0 deletions
Loading

.mermaid_validate/b0002.mmd

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
sequenceDiagram
2+
participant C as Client
3+
participant L as Leader
4+
participant F1 as Follower 1
5+
participant F2 as Follower 2
6+
7+
C->>L: Command X
8+
L->>L: Append to log (index 5, term 3)
9+
L->>F1: AppendEntries(index 5, term 3, X)
10+
L->>F2: AppendEntries(index 5, term 3, X)
11+
F1-->>L: Success
12+
F2-->>L: Success
13+
Note over L: Majority replicated; commit index 5
14+
L->>L: Apply X to state machine
15+
L-->>C: Result

.mermaid_validate/b0003.mmd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
flowchart LR
2+
CLIENT[Client] -->|write x=5| N1[Node 1<br/>x=5]
3+
N1 -->|replicate| N2[Node 2<br/>x=5 or x=?]
4+
N1 -->|replicate| N3[Node 3<br/>x=5 or x=?]
5+
CLIENT2[Another Client] -->|read x| N2

0 commit comments

Comments
 (0)