Will cockroachdb read data from replication and return?


(Nguyễn Văn Cao Nguyên) #1

For example I have 3 nodes with replication factor = 3.
Will cockroachdb always proxy the query to the owner node or return the replicated data when possible?
Thanks!


(Pete Vilter) #2

Hi nvcnvn,
At this point Cockroach proxies all reads and writes to the node which has the “leaseholder” replica, to ensure that all reads see the latest data.

For future versions, we are exploring a feature called “follower reads”, which will allow operators to configure reads for certain tables to go to followers, instead of the leaseholder. This would reduce the load on the leaseholder replica, but the data returned may be a bit stale, within a configurable threshold.

This guide gives more info on how to configure replication for good performance.

—Pete