I am pretty new to Cassandra so forgive me when I have some fundamental misunderstanding of the concept of keyspaces. What I am trying to do is to set up a multi datacenter ring in different regions with data replication NetworkTopologyStrategy endpoint_snitch set to GossipingPropertyFileSnitch hence as explained in the docs I need set the replication strategy for a keyspace
CREATE KEYSPACE "mykey"
WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'dc1' : 2, 'dc2' : 2};
i also read that in cql i can do "use mykey" to set the keyspace
would that be persistantly set then in the cassandra configurtation? As far as i understand each application client in a cluster uses its own keyspace right. Hence i would need to set this in the application??
The examples only show how to create a keyspace for configuring replication strategy options. I i think i managed to understand the basics behind it. What i am looking for is examples how i would tell cassandra to use a certain keyspace strategy (consistently and/or application dependent).
I digged some more in the cassandra docs and think i got a better aubderstanding about the use of keyspace. Am i correct in that for telling cassandra to use a certain keyspace i can create keyspace like so
CREATE KEYSPACE "MyKey" WITH replication = {'class':
'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true;
and then create tables in this keyspace like so
CREATE TABLE "MyKey"."TableName" (
...
Would this make cassandra to always use the configured replication strategy in the "MyKey" keyspace for that table?