Does collections in CQL3 have certain limits?

后端 未结 5 545
灰色年华
灰色年华 2020-12-17 17:32

As there are two ways to support wide rows in CQL3..One is to use composite keys and another is to use collections like Map, List and Set. The composite keys method can have

5条回答
  •  既然无缘
    2020-12-17 18:19

    It is strongly recommended to store only a limited amount of data in collections & maps.

    The reasons:

    1. Collections and maps are fetched as a whole, entirely. You can not "slice" on collections so putting lots of data in collections/maps will have impact on perf when reading them

    2. The CQL3 implementation of Lists is not performant for insertion/removal in the middle of the list. For append/prepend operations, it's quite fast. For insertion/removal element at index i, it will require a read-before-write. Basically, part of the list will be re-written because they need to be shifted to the good index

    3. Insertion/removal for Set and Map are more performant since they use the column key for storage/sorting/indexing

    Now to answer to your question, is there a hard limit on the number of elements in a collection/map, the answer is no, technically there is no limit other than the classical 2 billions limit that already exist in Thrift yes, it is limited to 65536 as mentioned above by GlynD.

    The related JIRA CASSANDRA-5428

提交回复
热议问题