Misunderstanding on Composite Key for Cassandra

烂漫一生 提交于 2019-11-30 09:28:53
libjack

If you use Order Preserving Partitioning (OPP), then yes, the keys will be stored sorted, and then you can get slices over a range of keys e.g. A:A to A:Z -- but not necessarily any:A to any:Z.

But, OPP is not guaranteed to evenly distribute the keys across the nodes and you could end up with "hot spots" of too many or too few keys. You probably want to use Random Partitioning (RP) which distributes the keys by storing by hash across all nodes.

However, since Columns are stored sorted, using Composite values can be pretty powerful for accessing ranges of data.

See this question for details on querying Composite columns using Hector .

If necessary, the column names could then be used as keys to do Multiget queries for additional lookups.

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