Creating collections

CQL defines the following collection data types:

Collections are intended for insertion and retrieval as a collection. Thus, Astra DB Serverless reads collections in their entirety, and can affect retrieval performance. A good rule of thumb is that sets are more performant than lists, so use a set if you can. Collections should be smaller than the following maximum size to prevent querying delays.

Guard rails for non-frozen collections:

  • No more than 2 billion items in a collection.

  • Maximum size of an item in a set is 65,535 bytes.

  • Maximum size of an item in a list or map is 2 GB.

  • Maximum number of keys in a map is 65,535.

  • Lists can incur a read-before-write operation for some insertions.

Collections are not paged internally.

Collections cannot be sliced;

The limits specified for collections are for non-frozen collections.

You can expire each element of a collection by setting an individual time-to-live (TTL) property.


Freezing collection types

A collection column is declared using the collection type, followed by another type.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com