You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Flavio Baronti <f....@list-group.com> on 2013/03/08 18:13:06 UTC

Time series data and deletion

Hello,

we are using Cassandra for storing time series data. We never update, only append; we plan to store 1 year worth of 
data, occupying something around 200Gb. I'm trying to understand what will happen when we start deleting the old data.

With size tiered compaction, suppose we have one 160Gb sstable and some smaller tables totalling 40Gb. My understanding 
is that, even if we start deleting, we will have to wait for 3 more 160Gb tables to appear, in order to have the first 
sstable compacted and the disk space freed. So although we need to store 200Gb worth of data, we'll need something like 
800Gb disk space in order to be on the safe side, right?

What would happen instead with leveled compaction? And why is the default sstable size so small (5Mb)? If we need to 
store 200Gb, this means we will have 40k sstables; since each one makes 5 files, we'll have 200k files in a single 
directory, which we'm afraid will undermine the stability of the file system.

Thank you for your suggestions!

Flavio


Re: Time series data and deletion

Posted by Tyler Hobbs <ty...@datastax.com>.
On Mon, Mar 11, 2013 at 11:25 AM, Flavio Baronti
<f....@list-group.com>wrote:

>
>
> One more question. I read and reread your description of deletes [1],  but
> I still am confused on tombstones and GCGraceSeconds, specifically when you
> say "If the deletion is before gcBefore it is totally ignored".
> Suppose I delete something, but compaction between the tombstone and the
> deleted data does not happen within GCGraceSeconds. From what I understood,
> it looks like the tombstone will be ignored, and the data will
> "resurrect"... where am I wrong?


This may answer your questions:
http://wiki.apache.org/cassandra/DistributedDeletes


-- 
Tyler Hobbs
DataStax <http://datastax.com/>

Re: Time series data and deletion

Posted by Flavio Baronti <f....@list-group.com>.
Il 2013/03/11 14:42 PM, aaron morton ha scritto:
>> I'm trying to understand what will happen when we start deleting the old data.
> Are you going to delete data or use the TTL?
We delete the data explicitly, since we might change idea on the data TTL after it has been written.
>
>> With size tiered compaction, suppose we have one 160Gb sstable and some smaller tables totalling 40Gb.
> Not sure on that, it depends on the work load.
NVM, was just a hypothesis.
>
>>  My understanding is that, even if we start deleting, we will have to wait for 3 more 160Gb tables to appear, in 
>> order to have the first sstable compacted and the disk space freed. 
> v1.2 will run compactions on single SSTables that have a high number of tombstones
> https://issues.apache.org/jira/browse/CASSANDRA-3442
> https://issues.apache.org/jira/browse/CASSANDRA-4234
I did not know about these improvements in 1.2! We're still on 1.0.12, I'll push for an upgrade.

One more question. I read and reread your description of deletes [1],  but I still am confused on tombstones and 
GCGraceSeconds, specifically when you say "If the deletion is before gcBefore it is totally ignored".
Suppose I delete something, but compaction between the tombstone and the deleted data does not happen within 
GCGraceSeconds. From what I understood, it looks like the tombstone will be ignored, and the data will "resurrect"... 
where am I wrong?

Cheers
Flavio

[1] http://thelastpickle.com/2011/05/15/Deletes-and-Tombstones/#local_reads_for_local_queries

Re: Time series data and deletion

Posted by aaron morton <aa...@thelastpickle.com>.
> I'm trying to understand what will happen when we start deleting the old data.
Are you going to delete data or use the TTL?

> With size tiered compaction, suppose we have one 160Gb sstable and some smaller tables totalling 40Gb.
Not sure on that, it depends on the work load. 

>  My understanding is that, even if we start deleting, we will have to wait for 3 more 160Gb tables to appear, in order to have the first sstable compacted and the disk space freed. 
v1.2 will run compactions on single SSTables that have a high number of tombstones 
https://issues.apache.org/jira/browse/CASSANDRA-3442
https://issues.apache.org/jira/browse/CASSANDRA-4234

>  So although we need to store 200Gb worth of data, we'll need something like 800Gb disk space in order to be on the safe side, right?

You want to keep the disks below 75% capacity, and want to have free space to handle node moves etc.  
I do not think you need 800GB because of tombstones deletions. 

> What would happen instead with leveled compaction? 
Levelled compaction is more suited to workloads that have a high insert/delete ratio. In your case, write once read many data is will suited to Sized Tiered. 

Cheers
 
-----------------
Aaron Morton
Freelance Cassandra Consultant
New Zealand

@aaronmorton
http://www.thelastpickle.com

On 8/03/2013, at 9:13 AM, Flavio Baronti <f....@list-group.com> wrote:

> Hello,
> 
> we are using Cassandra for storing time series data. We never update, only append; we plan to store 1 year worth of data, occupying something around 200Gb. I'm trying to understand what will happen when we start deleting the old data.
> 
> With size tiered compaction, suppose we have one 160Gb sstable and some smaller tables totalling 40Gb. My understanding is that, even if we start deleting, we will have to wait for 3 more 160Gb tables to appear, in order to have the first sstable compacted and the disk space freed. So although we need to store 200Gb worth of data, we'll need something like 800Gb disk space in order to be on the safe side, right?
> 
> What would happen instead with leveled compaction? And why is the default sstable size so small (5Mb)? If we need to store 200Gb, this means we will have 40k sstables; since each one makes 5 files, we'll have 200k files in a single directory, which we'm afraid will undermine the stability of the file system.
> 
> Thank you for your suggestions!
> 
> Flavio
>