await dbAdmin.createKeyspace('my_keyspace');
await dbAdmin.createKeyspace('my_keyspace', {
replication: {
class: 'SimpleStrategy',
replicatonFactor: 3,
},
});
await dbAdmin.createKeyspace('my_keyspace', {
replication: {
class: 'NetworkTopologyStrategy',
datacenter1: 3,
datacenter1: 2,
},
});
See the datastax docs for more info.
Represents the replication options for a keyspace.
Two replication strategies are available:
SimpleStrategy: Use only for a single datacenter and one rack. If you ever intend more than one datacenter, use the
NetworkTopologyStrategy
.NetworkTopologyStrategy: Highly recommended for most deployments because it is much easier to expand to multiple datacenters when required by future expansion.
If no replication options are provided, it will default to
'SimpleStrategy'
with a replication factor of1
.