LPD
LPD

Reputation: 2883

TTL Behavior - HBase

We have lot of data in a HBase table. Am new to this NoSQL world. We are looking to keep data only for fixed time. Should we write a separate clean up script or can we rely on TTL configuration?

I went through the docs available but am not understanding the exact behaviour.

Upvotes: 2

Views: 7966

Answers (3)

Tariq
Tariq

Reputation: 34184

It behaves the way it says, i.e all the values in a row whose timestamps are older than the configured TTL will be deleted at the next major compaction. It is an attribute of the column family. If you want the TTL to apply to the entire table, simply set it to the same value for each column family in the table. This way you will get rid of the data once you are done with it.

Upvotes: 1

David
David

Reputation: 3261

Remember that data is never deleted by HBase until it does a compaction -- where it rewrites all of its data files. Once the data passes it TTL it will be invisible until a major compaction happens.

Upvotes: 2

Praveen Sripati
Praveen Sripati

Reputation: 33495

The HBase documentation clearly says that data older than TTL will be automatically deleted by HBase.

Upvotes: 3

Related Questions