<p>Can I prevent a keyspace from syncing over to another datacenter by NOT including the other datacenter in my keyspace replication definition?
Apparently, this is not the case.</p>

<p>In my own test, I have set up two Kubernetes clusters in GCP, each serves as a Cassandra datacenter.  Each k8s clusters have 3 nodes.</p>

<p>I set up datacenter DC-WEST first, and create a keyspace demo using this:
<code>CREATE KEYSPACE demo WITH replication = {‘class’: ‘NetworkTopologyStrategy’, ‘DC-WEST’ : 3};</code></p>

<p>Then I set up datacenter DC-EAST, without adding any use keyspaces.</p>

<p>To join the two data centers, I modify the <code>CASSANDRA_SEEDS</code> environment variable in the Cassandra StatefulSet YAML to include seeds nodes from both datacenters (I use host networking).</p>

<p>But after that, I notice the keyspace <code>demo</code> is synced over to DC-EAST, even though the keyspace only has DC-WEST in the replication.</p>

<pre><code>cqlsh&gt; select data_center from system.local
... ;

data_center
-------------
DC-EAST     &lt;-- Note: this is from the DC-EAST datacenter

(1 rows)
cqlsh&gt; desc keyspace demo

CREATE KEYSPACE demo WITH replication = {'class': 'NetworkTopologyStrategy', 'DC-WEST': '3'}  AND durable_writes = true;
</code></pre>

<p>So we see in DC-EAST the <code>demo</code> keyspace which should be replicated only on DC-WEST!  What am I doing wrong?</p>

YTT
<p>Cassandra replication strategies control where data is placed, but the actual schema (the existence of the table/datacenters/etc) is global.</p>

<p>If you create a keyspace that only lives in one DC, all other DCs will still see the keyspace in their schema, and will even make the directory structure on disk, though no data will be replicated to those hosts.</p>
