A keyspace is like an RDBMS database that is used to defines data replication on nodes.
Syntex:
CREATE KEYSPACE WITH
CREATE KEYSPACE “KeySpace Name”
WITH replication = {'class': ‘Strategy name’, 'replication_factor' : ‘No.Of replicas’}
AND durable_writes = ‘Boolean value’;
Example (test_keyspace):
CREATE KEYSPACE test_keyspace
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}
AND durable_writes = 'true';
DESCRIBE KEYSPACES
SELECT * FROM system_schema.keyspaces;
Using Keyspace:
use test_keyspace;
Syntax:
DROP KEYSPACE keyspace_name;
Example:
DROP KEYSPACE test_keyspace;