user3661080
user3661080

Reputation: 11

Cassandra, why SSTABLE count is 3 for 1 column family (table)

I am new to cassandra, 1) why single column family have 3 sstable. 2) is it each column of the Table ( column family) stored in different nodes in a ring? or completely column family stored in single node ( if I not set replication factor).

example: Table: message1

SSTable count: 3

    Space used (live), bytes: 221521
    Space used (total), bytes: 226349
    SSTable Compression Ratio: 0.2548965072049006
    Number of keys (estimate): 384
    Memtable cell count: 7817866
    Memtable data size, bytes: 38797312
    Memtable switch count: 51
    Local read count: 0
    Local read latency: 0.000 ms
    Local write count: 26539152
    Local write latency: 0.000 ms
    Pending tasks: 0
    Bloom filter false positives: 0

3)

commitlog_sync: periodic commitlog_sync_period_in_ms: 10000

Commitlog Sync is 10 sec. But the data is not transferred or flushed to disc?. Memtable data size, bytes: 38797312

Upvotes: 0

Views: 1089

Answers (3)

Shivanshu Goyal
Shivanshu Goyal

Reputation: 530

1) why single column family has 3 sstable?

A new SSTABLE is created whenever a memtable is flushed onto the disk. when does this flush happen? When memtable is full or the commit log is full or manual flush is triggered. There is a limit for the number of SSTABLEs in a node, this limit is configurable (min_threshold i.e. maximum number of sstables can be present in a node at a time). When this limit is breached, compaction is triggered which merges SSTABLES and creates a new SSTABLE with the latest timestamped data from all SSTABLES by partition key.

2) is it each column of the Table?

There is no 1-1 mapping b/w column family and sstable. A new SSTABLE is created whenever a memtable is flushed onto disk.

Upvotes: 1

Yasmeen
Yasmeen

Reputation: 819

SSTable is immutable hence when ever an inserts/updates occur, instead of overwriting the rows, Cassandra writes a new timestamped version of the inserted or updated data in another SSTable. By performing compaction you can merge all the SStable into one single SSTable.

Compaction merges the data in each SSTable data by partition key, selecting the latest data for storage based on its timestamp.

http://www.datastax.com/documentation/cassandra/2.0/cassandra/dml/dml_write_path_c.html

Upvotes: 1

kkmishra
kkmishra

Reputation: 709

You should look into it.

As per I know Cassandra creates three file for SSTable one for data, other one for bloom filter and third one for indexes.

I think it will help you.

Upvotes: 0

Related Questions