Database Reference
In-Depth Information
If you write a new record with a key that already exists in a column family, the values for any
existing columns will be overwritten, and any columns that previously were not present for that
row will be added to the row.
Basic Write Properties
There are a few basic properties of Cassandra's write ability that are worth noting. First, writing
data is very fast in Cassandra, because its design does not require performing disk reads or seeks.
The memtables and SSTables save Cassandra from having to perform these operations on writes,
which slow down many databases. All writes in Cassandra are append-only.
Because of the database commit log and hinted handoff design, the database is always writeable,
and within a column family, writes are always atomic.
Consistency Levels
Cassandra's tuneable consistency levels mean that you can specify in your queries how much
consistency you require. A higher consistency level means that more nodes need to respond to
the query, giving you more assurance that the values present on each replica are the same. If two
nodes respond with different timestamps, the newest value wins, and that's what will be returned
to the client. In the background, Cassandra will then perform what's called a readrepair: it takes
notice of the fact that one or more replicas responded to a query with an outdated value, and
updates those replicas with the most current value so that they are all consistent.
There are several consistency levels that you can specify, and they mean something different for
read operations than for write operations. The possible consistency levels, and the implications
of specifying each one for read queries, are shown in Table 7-1 .
NOTE
The consistency levels are based on the replication factor specified in the configuration file, noton the
total number of nodes in the system.
Search WWH ::




Custom Search