title: What are the correct Cassandra collection limits?
body: <p>I'm testing an application where the size of the collections is bound to grow in the future and 64k is a limit that may be reached in some cases. </p>
  
  <p>This question is about the collection size limit as there seems to be a contradiction in the official documentation.</p>
  
  <p>As per <a href="https://docs.datastax.com/en/cql/3.1/cql/cql_using/use_collections_c.html" rel="nofollow noreferrer">this</a> document: </p>
  
  <blockquote>
    <p>If you insert more than 64K items into a collection, only 64K of them
    will be queryable, resulting in data loss.</p>
  </blockquote>
  
  <p>But if you click through to the <a href="https://docs.datastax.com/en/cql/3.1/cql/cql_reference/refLimits.html" rel="nofollow noreferrer">CQL Limits link</a> on that very page you see this:</p>
  
  <blockquote>
    <ul>
    <li><p>Collection (List): <strong>collection size: 2B</strong> (2^31); values size: 65535 (2^16-1) (Cassandra 2.1 and later, using native protocol v3)</p></li>
    <li><p>Collection (Set): <strong>collection size: 2B</strong> (2^31); values size: 65535 (2^16-1) (Cassandra 2.1 and later, using native protocol v3)</p></li>
    <li><p>Collection (Map): <strong>collection size: 2B</strong> (2^31); number of keys: 65535 (2^16-1); values size: 65535 (2^16-1) (Cassandra 2.1 and later, using
    native protocol v3)</p></li>
    </ul>
  </blockquote>
  
  <p>So which one is it? 64k items per collection, or 2 billion items per collection? Or are 2 billion <em>writeable</em> but not readable beyond 64k? </p>
  
  <p>Thanks in advance.</p>