O'Reilly logo

Apache Cassandra Essentials by Nitin Padalia

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Write operations

In Cassandra, both UPDATE and INSERT statements are write operations, which means that these operation don't do any reading before writing. This implies that, if we're executing an UPDATE operation on a primary key and the row for that primary key doesn't exist, UPDATE will insert a new row.

Similarly, if we're performing an INSERT operation and the row mentioned in the INSERT operation identified by the primary key already exists in the database, that row will be overwritten by our INSERT operation.

This is why we call them UPSERT operations as well.

Note

UPSERT operations are valid operations in Cassandra and won't throw any errors.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required