Cassandra file structure - how are the files used?

前端 未结 2 1836
梦谈多话
梦谈多话 2021-01-31 18:57

When experimenting with Cassandra I\'ve observed that Cassandra writes to the following files:

/.../cassandra/commitlog/CommitLog-.log
/.../cassandra/d         


        
相关标签:
2条回答
  • 2021-01-31 19:48

    A write to a Cassandra node first hits the CommitLog (sequential). (Then Cassandra stores values to column-family specific, in-memory data structures called Memtables. The Memtables are flushed to disk whenever one of the configurable thresholds is exceeded. (1, datasize in memtable. 2, # of objects reach certain limit, 3, lifetime of a memtable expires.))

    The data folder contains a subfolder for each keyspace. Each subfolder contains three kind of files:

    • Data files: An SSTable (nomenclature borrowed from Google) stands for Sorted Strings Table and is a file of key-value string pairs (sorted by keys).
    • Index file: (Key, offset) pairs (points into data file)
    • Bloom filter: all keys in data file
    0 讨论(0)
  • 2021-01-31 19:58

    Cassandra File Format in detail

    Each ColumnFamily(Eg. object) in separated sstable files

    ColumnFamilyName-version-#-Data.db
    ColumnFamilyName-version-#-Index.db
    ColumnFamilyName-version-#-Filter.db
    

    enter image description here

    0 讨论(0)
提交回复
热议问题