What is the index structure of Cassandra

佐手、 提交于 2021-02-08 08:28:20

问题


Cassandra uses LSM tree for storage, but what exactly is the index structure of cassandra ? For e.g Both Mongo and Couchbase use BTree.


回答1:


It depends on the version of Cassandra you are actually using.

For version prior to 3.4 indexes are implemented as hidden Cassandra tables holding the key value of the data you wish to access. Main disadvantage of this strategy is that since SStables are subjected to compactions, you cannot reference data directly, instead you are given a key, and you have to go through the read path again.

In version 3.4 they introduced SASI indexes (SSTable Attached Secondary Indexes). Basically a portion of the index is associated to each SStable and hence distributed with it. This means you can actually use references to access data rather than pay for another read path. In terms of implementation, they are b-trees.

Here is a really useful resource on the subject.



来源:https://stackoverflow.com/questions/41759807/what-is-the-index-structure-of-cassandra

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!