Database Reference
In-Depth Information
LocalStrategy
LocalStrategy is available for internal purposes and is used for system and
system_auth keyspaces. System and system_auth are internal keyspaces, im-
plicitly handled by Cassandra's storage architecture for managing authorization and au-
thentication. These keyspaces also keep metadata about user-defined keyspaces and
column families. In the next chapter we will discuss them in detail. Trying to create
keyspace with strategy class as LocalStrategy is not permissible in Cassandra and
would give an error like “LocalStrategy is for Cassandra's internal purpose only”.
NetworkTopologyStrategy
NetworkTopologyStrategy is preferred if multiple replica nodes need to be
placed on different data centers. We can create a keyspace with this strategy as
CREATE KEYSPACE apress WITH replication = {'class':
'NetworkTopologyStrategy', 'dc1' : 2, 'dc2' : 3};
Here dc1 and dc2 are data center names with replication factor of 2 and 3 respect-
ively. Data center names are derived from a configured snitch property.
SimpleStrategy
SimpleStrategy is recommended for multiple nodes over multiple racks in a
single data center.
CREATE KEYSPACE apress WITH replication = {'class':
'SimpleStrategy', 'replication_factor' : 3};
Here, replication factor 3 would mean to replicate data on 3 nodes and strategy
class SimpleStrategy would mean to have those Cassandra nodes within the same data
center.
Cassandra Multiple Node Configuration
Search WWH ::




Custom Search