6 Writing data to ScyllaDB

 

This chapter covers

  • Inserting, updating, and deleting data
  • Executing multiple concurrent queries via batch query
  • Deleting data automatically via time to live
  • Updating data conditionally with lightweight transactions

If you want to learn about writes to ScyllaDB, this chapter is the place: you’ll learn how Scylla handles mutating data—creating it, updating it, and deleting it. Writes may have seemed a straightforward operation when first introduced in chapter 2, but that’s the beauty of Scylla’s implementation: it provides a less-complicated interface and hides the complexity of the operation while still exposing some neat features to fit specialized use cases. Let’s first look at inserting and updating data.

6.1 Inserting and updating data

In chapter 2, you learned how to insert and update data in ScyllaDB. It’s a skill you’ve been using; you had your first basic reviews and your data-type playgrounds. You’ve got the basics, but in this section, we’ll look deeper into how inserts and updates work, the small differences between them, and some ScyllaDB features that interact with writes and how Scylla stores data.

6.1.1 Writing data

6.1.2 Concurrent operations

6.2 Deleting data

6.2.1 Executing deletes

6.2.2 Tombstones

6.2.3 Compaction

6.2.4 Deleting multiple rows

6.3 Time to live

6.3.1 Expiring temporary data

6.3.2 The difference between inserts and updates

6.3.3 Table TTLs

6.4 Batching data

6.4.1 Executing a batch

6.4.2 Logged vs. unlogged batches