Database / Apache Cassandra Intermediate and Advanced interview questions
What is gc_grace_seconds and why does it matter?
gc_grace_seconds is a per-table setting that defines how long a tombstone must be kept before it becomes eligible for permanent removal during compaction. It defaults to 864000 seconds (10 days).
- The window exists to give every replica a chance to receive the delete, whether through the original write, hinted handoff, or anti-entropy repair.
- If a tombstone is purged before an out-of-sync replica ever saw it, that replica's old, undeleted copy can resurface during a later read or repair — this is called zombie data.
- The operational rule of thumb is: always run repair more often than gc_grace_seconds, so every replica is guaranteed to be reconciled before tombstones age out.
ALTER TABLE sessions WITH gc_grace_seconds = 86400; -- 1 day, common for tables with heavy deletes/TTL
Lowering gc_grace_seconds is common on tables that rely heavily on TTL expiration (to reclaim disk space faster), but it is only safe if repairs are actually scheduled frequently enough to keep pace with the shorter window.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
