The Log-structured Merge-Tree storage engine in Apache Cassandra allows for fast write performance, but has some potential downsides when it comes to deleting data. Expired columns (from TTL's) and Tombstones can impact on read performance until they are purged from disk by Compaction. And while different Compaction Strategies are suited to different workloads, they must all ensure deleted data stays deleted.
1. Licensed under a Creative Commons Attribution-NonCommercial 3.0 New Zealand License
SOUTH BAY CASSANDRA USERS MAY 2015
TTL,TOMBSTONES,AND
COMPACTION
Licensed under a Creative Commons Attribution-NonCommercial 3.0 New Zealand License
Aaron Morton
@aaronmorton
Co-Founder &Team Member
2. AboutThe Last Pickle.
Work with clients to deliver and
improve Apache Cassandra based
solutions.
Based in New Zealand, USA,
Norway.
18. TTL
public class BufferExpiringCell extends BufferCell
implements ExpiringCell
{
private final int localExpirationTime;
private final int timeToLive;
…
}
20. Tombstone (For A Cell)
public class BufferDeletedCell extends BufferCell implements
DeletedCell
{
public BufferDeletedCell(CellName name, int localDeletionTime,
long timestamp)
{
this(name, ByteBufferUtil.bytes(localDeletionTime),
timestamp);
}
}
22. Tombstone (For A Partition)
public class DeletionInfo implements IMeasurableMemory
{
public DeletionInfo(long markedForDeleteAt, int
localDeletionTime)
{
…
}
}
23. Tombstone (For A Range)
public class RangeTombstone extends Interval<Composite,
DeletionTime> implements OnDiskAtom
{
public RangeTombstone(Composite start, Composite stop, long
markedForDeleteAt, int localDeletionTime)
{
…
}
}
65. Licensed under a Creative Commons Attribution-NonCommercial 3.0 New Zealand License
Aaron Morton
@aaronmorton
Co-Founder &Team Member
www.thelastpickle.com
Licensed under a Creative Commons Attribution-NonCommercial 3.0 New Zealand License