educative.io

Educative

Read and write operation in Consistent hashing

Hi,
Please help in understanding if consistent hashing is used on a DB, do we do read and write operations on the same set of nodes in the ring? If read/write operations are performed on same set of nodes , it is possible that write query and read query reaches the same node at one time? Isn’t this going to bring slowness in responding to read?

Thanks


Type your question above this line.

Course: https://www.educative.io/collection/5668639101419520/5649050225344512
Lesson: https://www.educative.io/collection/page/5668639101419520/5649050225344512/5709068098338816

Hi, @Jyoti
Yes, we can do read and write on the same set of nodes in the ring, and if they are performed simultaneously, then our service will not get slow because we are using consistent hashing, which divides the loads in different servers. So when we perform a read or write operation, it will call the MD5 hashing algorithm, which will retrieve the data from the resultant load. In this way, our load is divided into different nodes, so it won’t slow down the read time.