4

I know that etcd uses the Raft protocol to achieve consensus among multiple nodes. Raft is usually presented as storing data as key-value pairs in the replicated log; does etcd store its key-value data directly in that Raft log, or is there some sort of abstraction/indirection between the Raft log and etcd's data store?

DylanSp
  • 1,379
  • 13
  • 27

2 Answers2

0

The indirection is the StateMachine.

etcd looks to be using bbolt-db as its storage manager; see the source.

Asad Awadia
  • 1,417
  • 2
  • 9
  • 15
0

The final store for etcd is the bbolt database which is the MVCC store. The raft log is a write-ahead log (aka WAL) that is used to achieve consensus among leader and followers and prevent loss of information received from client.

Lets say a write request comes to a follower. It is re-directed to leader. Leader writes the request to its WAL and sends it to all followers using Raft. Once quorum confirms that the write request has been written to their respective WAL, then leader commits the same to bbolt database and sends response to client.

So yes, you can think that there is "some sort of" indirection between Raft log (WAL) and etcd data store (bbolt database).

Ankur
  • 149
  • 10