<p>I`ve just read <em>Deploying Cassandra with Stateful Sets</em> topic in the Kubernetes documentation. 
The deployment process:
1. Creation of StorageClass 
2. Creation of PersistentVolume (in my case 4 PersistentVolume). Set created in 1) storageClassName
3. Creation of Cassandra Headless Service
4. Using a StatefulSet to Create a Cassandra Ring - setting created in 1) storageClassName in StatefulSet yml definition.</p>

<p>As a result, there are 4 pods: Cassandra-0, Cassandra-1, Cassandra-2, Cassandra-4, which are mounted to created in 2) volumes (pv-0, pv-1, pv-2, pv-3).
I wonder how / if these persistent volumes synchronize data with each other. </p>

<p>E.g. if I add some record, which will be written by pod cassandra-0 in persistent volume pv-0, then if someone who is going to retrieve data from the database a moment later - using the cassandra-1 pod/pv will see data that has been added to pv-0. Can anyone tell me how it works exactly?</p>

michf
<ol>
<li><p>This is not related to Kubernetes</p></li>
<li><p>The replication is done by database and is configurable</p></li>
<li><p>See the CAP theorem and Eventual Consistency for Cassandra </p></li>
<li><p>You can control the level of consistency in Cassandra, whether the record is immediately updated across or later , depends on the configuration you do in Cassandra. </p></li>
<li><p>See also: Synchronous Replication , Asynchronous Replication</p></li>
</ol>

<p>Cassandra Consistency:</p>

<p><a href="https://stackoverflow.com/questions/35731452/how-to-set-cassandra-read-and-write-consistency">how to set cassandra read and write consistency</a></p>

<p><a href="https://docs.datastax.com/en/archived/cassandra/3.0/cassandra/dml/dmlConfigConsistency.html" rel="nofollow noreferrer">How is the consistency level configured?
</a></p>
