Database Reference
In-Depth Information
Replliicattiion f
n facttor
In simplest terms, the replication factor refers to the number of nodes that will act as copies
(replicas) of each row of data. If your replication factor is 3, then three nodes in the ring will
have copies of each row, and this replication is transparent to clients.
The replication factor essentially allows you to decide how much you want to pay in per-
formance to gain more consistency. That is, your consistency level for reading and writing
data is based on the replication factor.
Replliica p
t sttrattegy
The replica placement refers to howthe replicas will be placed in the ring. There are different
strategies that ship with Cassandra for determining which nodes will get copies of which
keys. These are SimpleStrategy (formerly known as RackUnawareStrategy), OldNetworkTo-
pologyStrategy (formerly known as RackAwareStrategy), and NetworkTopologyStrategy
(formerly known as DatacenterShardStrategy).
a pllacement s
Collumn f
in famiilliies
In the same way that a database is a container for tables, a keyspace is a container for a list
of one or more column families. A columnfamilyis roughly analagous to a table in the rela-
tional model, and is a container for a collection of rows. Each row contains ordered columns.
Column families represent the structure of your data. Each keyspace has at least one and of-
ten many column families.
I mention the replication factor and replica placement strategy here because they are set per key-
space. However, they don't have an immediate impact on your data model per se.
It is possible, but generally not recommended, to create multiple keyspaces per application. The
only time you would want to split your application into multiple keyspaces is if you wanted a
different replication factor or replica placement strategy for some of the column families. For ex-
ample, if you have some data that is of lower priority, you could put it in its own keyspace with
a lower replication factor so that Cassandra doesn't have to work as hard to replicate it. But this
may be more complicated than it's worth. It's probably a better idea to start with one keyspace
and see whether you really need to tune at that level.
Column Families
A columnfamilyis a container for an ordered collection of rows, each of which is itself an
ordered collection of columns. In the relational world, when you are physically creating your
database from a model, you specify the name of the database (keyspace), the names of the tables
Search WWH ::




Custom Search