All nodes in the Cassandra cluster are peers, so read/write operations can occur on any node in the cluster, and perhaps this node does not require read/write data, so the node that interacts with the user becomes the coordinator node.
Write request for single data center:
When the client is sent to the coordinator node, the coordinator node sends the write request to all nodes in the cluster that have a replica of the target row (target node), such as:
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/database/extra/
In this example, the client sends the request to N10, but the N10 does not have the target row, so N10 is the coordinator node, which knows that the target line has 3 copies R1,r2,r3, followed by n1,n2,n7, so it writes requests to the 3 nodes. If there is an I successful response returned to N10 (I depends on the value of the consistency level configuration), N10 considers the write operation completed successfully, thus returning the response message to the client.
Write requests from multiple data centers:
In multiple data centers, in order to optimize performance, the Cassandra Cluster will find a coordinator in each datacenter, and then the Coordinator is responsible for the write operations of multiple replica nodes in the data center where they reside.
For example, in this example, DC1 's coordinator is N10,DC2 coordinator is also N10, then the client simply sends the write request to these 2 coordinator to be possible.
Read Request:
or find Coordinator,coordinator. A node "direct read" request sent to the consistency level number to return the result to the client, while the node "read repair" request sent to the other replica is used to synchronize the data.
In this case, for example, if there are 3 copies, but the consistency level is set to 2, coordinator will send a "direct read" request to two nodes (such as R1 and R3), while in the background, a "read fix" request will be sent to a third node (for example, R2)
This article from the "Cohesion of parallel Lines" blog, please be sure to retain this source http://supercharles888.blog.51cto.com/609344/865657