Performance of collection operations

Most collection operations do not involve Cassandra reading data internally; they are purely write-without-reading, which, we recall, is the most efficient pattern for Cassandra data manipulation. Lists, however, are a partial exception to this rule, in three cases, as follows:

  • Writing an element at a specific index
  • Removing an element at a specific index
  • Removing all occurrences of a given value

These three operations do require Cassandra to read the full list before manipulating it and are, therefore, slower than other collection manipulations. It's best to avoid these three operations in performance-sensitive code.

All other collection updates are entirely write-without-reading and can thus be performed ...

Get Learning Apache Cassandra - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.