DataStax Academy FAQ

DataStax Academy migrated to a new learning management system (LMS) in July 2020. We are also moving to a new Cassandra Certification process so there are changes to exam bookings, voucher system and issuing of certificates.

Check out the Academy FAQ pages for answers to your questions:


question

chandrasekar.b03_190734 avatar image
chandrasekar.b03_190734 asked ·

What are tombstones and GC grace period?

What actually is tombstones and gc grace period? Could you please explain them in the way that helps me to understand easily?

I have come across the concept of tombstone and gc grace period that I can't get to understand and a lot confusing. Could you please explain the concept of tombstones and gc grace period & eager to know what that name implies ?

tombstones
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

Tombstones are deletion markers in Cassandra -- they are indicators that a column or row of data has been deleted.

In Cassandra, SSTables are immutable which means that they never change or get updated once they've been written to disk. When deleting data, the SSTable where the data is stored does not get modified. Instead, a tombstone is written (a DELETE is just another INSERT under the hood) as an optimisation that makes mutations (writes) very fast in Cassandra.

When reading data, a deleted row or column is filtered out of the result. Cassandra determines if it has been deleted by checking if a tombstone exists -- the row or column has been marked for deletion.

Tombstones have an expiry date. Cassandra holds the tombstones until they are expired. Over time, the deleted data accumulates in SSTables. After the grace period (gc_grace_seconds) has elapsed, the expired tombstones and deleted data are garbage-collected (GC) by the compaction processes.

These two documents discuss these topics in detail:

Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.