Does etcd cache data locally

33 views
Skip to first unread message

ishan...@go-mmt.com

unread,
May 6, 2019, 4:37:35 AM5/6/19
to etcd-dev
Hi,

I have been going through the documentation and though the slides explaining the Raft algorithm do suggest that etcd does keeps local copies of data, which are kept in sync among the various nodes in the cluster.
I was wondering if there is any documentation that points to this as a fact. What I really want to know is:

1. Let's assume all nodes are properly synced and each node has all the updated KV pairs.
2. If I do a key lookup on any one node locally, it should not result in any Network I/O
3. Although etcd might do network I/O to keep data in sync, but my code which is frequently reading KV pairs from etcd locally would avoid a lot of network I/O

Do I understand this flow correctly?

Regards,
Ishan

Jingyi Hu

unread,
May 6, 2019, 4:32:02 PM5/6/19
to ishan...@go-mmt.com, etcd-dev
Roughly speaking, local node needs to communicate with leader node (via network I/O) to find out if it the requested key is still in sync before it serves the request.

::DISCLAIMER::

----------------------------------------------------------------------------------------------------------------------------------------------------


This message is intended only for the use of the addressee and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify us immediately by return e-mail and delete this e-mail and all attachments from your system.

--
You received this message because you are subscribed to the Google Groups "etcd-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to etcd-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jingyi Hu

unread,
May 6, 2019, 4:36:34 PM5/6/19
to ishan...@go-mmt.com, etcd-dev
Sorry I was assuming you are doing linearizable [1] read. For serializalible read, local node can serve locally (no network I/O).

Jingyi Hu

unread,
May 6, 2019, 4:43:56 PM5/6/19
to ishan...@go-mmt.com, etcd-dev
For more description of the request flow, please refer to section 6.4 in raft paper. You can find the corresponding implementation in https://github.com/etcd-io/etcd/blob/master/raft/raft.go 
Reply all
Reply to author
Forward
0 new messages