Cassandra write/read protocol between nodes

187 Views Asked by At

Could some one help me understand what protocol nodes use when they talk to each other at the time of write and read e.g. a Client connects to a coordinator node for write, then coordinator node forwards the write to the appropriate node which owns the shard. Now my question is, what protocol do they use is this case (Cassandra code reference will also be super helpful)?

I understand the nodes use gossip for propagating state information about themselves and about other nodes they know about but trying to understand the protocol for write and read between the nodes.

1

There are 1 best solutions below

1
On

Each Cassandra node is aware about the ring state of the cluster using gossip. When a node(coordinator) get a request for read/write, it applies practitioner hash function to identify the primary node responsible for the data and also the replica nodes. Then depending on the consistency it waits for the acknowledgement from the required number of nodes. You can refer this blog's , Section "Write Flow Example". I am not aware about the protocol but it is good to understand the algorithm how read/write request are handled by coordinator.