I have been learning about docker engine for past 2 months and I got to know that docker swarm uses Raft algorithm which has been implemented natively without other services like etcd. I made a simple project which monitors server health in a distributed system to understand Raft algorithm. I implemented it using GoLang.
Github link : Click here to see the GitHub repo
Before getting into project details lets first understand Raft Algorithm
Raft Alorithm: Raft is a sophisticated algorithm that is used in etcd for monitoring servers and more. It uses leader election to monitor servers and log replication to maintain same state among all the nodes in the cluster. Its used in most of the places because its easy to implement and understand. It also provides fault tolerance.
Know more about Raft and its uses:
🤨 So what happens when you run the code ? 🤔
When you run the code in a cluster following steps are executed.
Note: This project doesn’t flush the memory. So the all the logs will be in the memory.
Want to learn Raft in a interactive way ?
Check out The secret lives of data