Database Reference
In-Depth Information
LeveledCompaction
The LeveledCompactionStrategy is based on Google's LevelDB. It is best suited
for ColumnFamilys with read-heavy workloads that have frequent updates to ex-
isting rows (as opposed to frequent creation of new rows). If you use LeveledCom-
paction, you will want to keep an eye on the read latency for that ColumnFamily.
If the nodes in the cluster can't keep up with the write workload and the number
of pending compactions is rising, the read performance will begin to suffer even
more. One of the major benefits of using LeveledCompaction is that you are
not required to perform the major compactions as frequently as you do on the
SizeTieredCompaction-based ColumnFamilys. Another major benefit is that you
do not need to keep double the amount of data on disk available to perform these
compactions when you do run them.
Tombstones
A tombstone is the special name for a value that marks a column as being deleted.
In a distributed system, writes (and therefore deletes) are typically done under the
assumption that not all nodes that contain the data need to be made aware of the
operation (according to the client). So when a delete operation happens on some
nodes and not others, Cassandra will mark the deleted row or column with a tomb-
stone and pass this marking along to the other machines responsible for the same
amount of data. Since data cannot be removed immediately, the tombstone is ad-
ded to the CommitLog and the actual data is removed from the SSTable on the
next compaction.
Cassandra has specifically designed a methodology for taking care of tomb-
stones. There is a constant called GCGraceSeconds. Each node tracks the age
of each tombstone locally. Once the tombstone has aged past that constant of
GCGraceSeconds, it can be garbage collected during a compaction. This is to say
that if a node is out of service for longer than GCGraceSeconds, you should treat
that node as failed and replace it (typically re-bootstrapping works well). The typ-
ical setting for GCGraceSeconds is ten days. But this is something that should be
tuned for your environment.
Search WWH ::




Custom Search