Book Image

Apache Cassandra Essentials

By : Nitin Padalia
Book Image

Apache Cassandra Essentials

By: Nitin Padalia

Overview of this book

Apache Cassandra Essentials takes you step-by-step from from the basics of installation to advanced installation options and database design techniques. It gives you all the information you need to effectively design a well distributed and high performance database. You’ll get to know about the steps that are performed by a Cassandra node when you execute a read/write query, which is essential to properly maintain of a Cassandra cluster and to debug any issues. Next, you’ll discover how to integrate a Cassandra driver in your applications and perform read/write operations. Finally, you’ll learn about the various tools provided by Cassandra for serviceability aspects such as logging, metrics, backup, and recovery.
Table of Contents (14 chapters)
Apache Cassandra Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

TTL


Sometimes we may want to expire or delete some data after a certain amount of time has elapsed. For example, in a column family of a user's status updates, we don't want to keep status updates of users for more than 100 days. One way of doing this is to create a monitoring job to keep track of such things and then delete such data. However, in Cassandra, these things can be taken care of by the database itself. This means a default TTL(time to live) operation could be specified for all the data of a column family as well as per INSERT or DELETE operation. TTL defines a time duration after which Cassandra will start removal process of the data. TTL precision is in seconds. Behind the hood, when a piece of data is removed, a tombstone is put onto it. Later on, tombstones are cleared during garbage collection of the normal compaction process after a period of time specified by the gc_grace_seconds configuration option.

Note

Tombstone age is calculated at each node of a cluster locally, so...