For the past few weeks I've been building Atlas , a distributed service-discovery system in Go. It answers one question every microservice setup eventually asks:
Where is the payments service right now, and which copies of it are actually alive?
Most tools answer that with a central database or a leader node (Consul's servers, etcd, ZooKeeper). I wanted to see how far I could get without any leader at all .
π GitHub: https://github.com/manziosee/atlas
π’ Live demo (read-only): open the dashboard
How it works
Every node runs the same ~14 MB binary. Nodes find each other with SWIM gossip , the same family of protocols behind HashiCorp's memberlist:
Each node pings a random peer every second.
No answer? It asks up to three other nodes to try ( ping-req ).
Still nothing? The peer is marked suspect , and the rumour spreads by gossip.
If the peer is actually alive, it refutes by bumping its incarnation number. Otherwise it's declared dead within seconds.
On top of that sits a service registry .β¦