A keyspace is Cassandra’s namespace for grouping tables. It also defines how Cassandra replicates the data stored in those tables, so Spring Data Cassandra needs a keyspace name before repositories can operate. section 4.1.1
A keyspace setup provides several practical decisions:
- Name the keyspace that repositories will use, such as tacocloud. section 4.1.1 section 13.3
- Choose a replication strategy and factor. SimpleStrategy with a factor of 1 keeps one copy of each row and suits a single-data-center demonstration. section 4.1.1
- Create the keyspace before connecting the application, usually through Cassandra’s CQL shell. section 4.1.1 section 13.3
Creating the Taco Cloud keyspace
Run the CQL shell against the Cassandra cluster, then create a keyspace with simple replication and durable writes: create keyspace tacocloud with replication={'class':'SimpleStrategy', 'replication_factor':1} and durable_writes=true. Point Spring Data Cassandra at tacocloud using the cassandra.keyspace-name setting. section 4.1.1 section 13.3
cqlsh> create keyspace tacocloud
... with replication={'class':'SimpleStrategy', 'replication_factor':1}
... and durable_writes=true;
Inspect the complete CQL statement for creating a single-node development keyspace. section 4.1.1

