Understanding Raft WAL Logs

My present understanding regarding this is that

  1. We have multiple Raft groups(each containing 3 nodes and storing data for a predicate). Note that a node doesn’t mean an instance here. An instance could act and typically would act as nodes for multiple predicates.

  2. Now each node has a memory storage and a WAL(this means a log per predicate). If I am thinking correct here then we could just use wal package - github.com/coreos/etcd/wal - Go Packages. Whenever a mutation comes, it is redirected to master of the group of nodes which form the Raft group for the predicate. Master writes it to its logs, sends it to other nodes(they write it to their logs), gets consensus and then the mutation is applied to all nodes.

  3. From what I understand RAFT library can be configured to use the memory storage(raft package - github.com/coreos/etcd/raft - Go Packages) for transmitting the entries to other instances. WAL is used to load data into memory in case a node restarts.

  4. Whenever a predicate has to be transferred to a new instance, we just make it part of the RAFT group for the predicate and data can then be streamed using Predicate RPC + the storage.

References

1 Like