Difference between Cassandra Row caching and Partition key caching

后端 未结 1 1038
清酒与你
清酒与你 2021-02-08 19:07

What is the difference between row cache and Partition key cache? shall i need to use both for the good performance Perspective.

I have already read the basic definition

相关标签:
1条回答
  • 2021-02-08 19:46

    TL;DR : You want to use Key Cache and most likely do NOT want row cache.

    Key cache helps C* know where a particular partition begins in the SStables. This means that C* does not have to read anything to determine the right place to seek to in the file to begin reading the row. This is good for almost all use cases because it speeds up reads considerably by potentially removing the need for an IOP in the read-path.

    Row Cache has a much more limited use case. Row cache pulls entire partitions into memory. If any part of that partition has been modified, the entire cache for that row is invalidated. For large partitions this means the cache can be frequently caching and invalidating big pieces of memory. Because you really need mostly static partitions for this to be useful, for most use cases it is recommended that you do not use Row Cache.

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