Summary
In this chapter, we added several new tools to our arsenal of Cassandra knowledge. You learned, among other things, that CQL's INSERT
and UPDATE
have behavior that's quite surprising to those who are accustomed to the equivalent operations in SQL, and that, in reality, both queries in CQL are performing an underlying upsert
operation.
We explored situations in which upserts
can produce undesirable behavior, particularly in situations where there is concurrent access to the same resource by multiple actors. Also, we introduced lightweight transactions in the form of conditional inserts and conditional updates as a way to mutate Cassandra data with some of the data integrity guarantees that we are used to having in relational databases.
In the next chapter, we will undertake an exploration of data structures within individual columns, exploring several different ways to store and manipulate multiple values within a single column.