liveBook · Manning

What you will learn in ScyllaDB in Action

by Bo Ingram

Chapter by chapter

Chapter 1: Introducing ScyllaDB

1.1 ScyllaDB, a different database · 1.1.1 Hypothetical databases · 1.1.2 Real-world databases · 1.1.3 Unpacking the definition · 1.2 ScyllaDB, a distributed database · 1.2.1 Distributing data · 1.2.2 ScyllaDB vs. relational databases · 1.2.3 ScyllaDB vs. Cassandra · 1.2.4 ScyllaDB vs. Amazon Aurora, Amazon DynamoDB, Google Cloud Spanner, and Google AlloyDB · 1.2.5 ScyllaDB vs. document stores · 1.2.6 ScyllaDB vs. distributed relational databases · 1.2.7 When to prefer other databases · 1.3 ScyllaDB, a practical database · 1.3.1 Fault tolerance · 1.3.2 Scalability · 1.3.3 Production usage · 1.4 Summary

What you learn in chapter 1 →

Chapter 2: Touring ScyllaDB

2.1 Launching your first cluster · 2.1.1 The first node · 2.1.2 Your new friend, nodetool · 2.1.3 Building the cluster · 2.2 Creating your first table · 2.2.1 Keyspaces and tables · 2.2.2 Creating a schema · 2.3 Running your first queries · 2.3.1 Inserting data · 2.3.2 Reading data · 2.3.3 Updating data · 2.3.4 Deleting data · 2.4 Handling failures · 2.4.1 Shutting down a node · 2.4.2 Experimenting with consistency · 2.5 Summary

What you learn in chapter 2 →

Chapter 3: Data modeling in ScyllaDB

3.1 Application design before schema design · 3.1.1 Your query-first design toolbox · 3.1.2 The sample application requirements · 3.1.3 Determining the queries · 3.2 Identifying tables · 3.2.1 Denormalization · 3.2.2 Extracting tables · 3.3 Distributing data efficiently on the hash ring · 3.3.1 The hash ring · 3.3.2 Making good partitions · 3.4 Summary

What you learn in chapter 3 →

Chapter 4: Data types in ScyllaDB

4.1 Preparing yourself · 4.1.1 Data-type playground · 4.1.2 Identifying the fields · 4.2 The most common types: Text and numbers · 4.2.1 Text · 4.2.2 Numbers · 4.3 Dates and times · 4.3.1 Working with dates and times · 4.3.2 Durations · 4.3.3 When to use timestamps, dates, and times · 4.4 IDs · 4.4.1 UUIDs · 4.4.2 Picking an ID type · 4.5 Collections · 4.5.1 Lists · 4.5.2 Sets · 4.5.3 Maps · 4.5.4 User-defined types · 4.5.5 Frozen collections · 4.5.6 Storing images · 4.6 A few other types to know · 4.6.1 Blobs · 4.6.2 IP addresses · 4.6.3 Counters · 4.7 Summary

What you learn in chapter 4 →

Chapter 5: Tables in ScyllaDB

5.1 Completing your query-first design · 5.1.1 Reviewing restaurant reviews · 5.1.2 The final two questions · 5.1.3 Bucketing · 5.1.4 Finishing the design · 5.2 Keyspace configuration · 5.2.1 SimpleStrategy · 5.2.2 NetworkTopologyStrategy · 5.3 Creating your application’s tables · 5.3.1 Articles · 5.3.2 Article summaries · 5.3.3 Authors · 5.4 Summary

What you learn in chapter 5 →

Chapter 6: Writing data to ScyllaDB

6.1 Inserting and updating 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 · 6.5 Lightweight transactions · 6.5.1 The power of IF · 6.5.2 Not lightweight · 6.6 Summary

What you learn in chapter 6 →

Chapter 7: Reading data from ScyllaDB

7.1 Selecting · 7.1.1 The basics · 7.1.2 Limiting results · 7.1.3 Paginating queries · 7.1.4 Ordering results · 7.1.5 Counting · 7.1.6 Grouping rows in your queries · 7.2 Read performance · 7.2.1 What does a read do? · 7.2.2 Avoiding slow queries · 7.2.3 Allowing filtering · 7.3 Materialized views · 7.3.1 Constructing a view · 7.3.2 Easier denormalization · 7.3.3 Indexes · 7.4 Summary

What you learn in chapter 7 →

Chapter 8: ScyllaDB’s architecture

8.1 Scylla’s design goals · 8.2 Distributed systems in Scylla · 8.2.1 Revisiting the hash ring · 8.2.2 Consistency · 8.2.3 Communication protocols · 8.2.4 Gossip · 8.2.5 Consensus · 8.3 On-node architecture · 8.3.1 The memtable and the commit log · 8.3.2 Shards · 8.3.3 SSTables · 8.3.4 Tablets: The future · 8.4 Cluster operations · 8.4.1 Compaction · 8.4.2 Repairs · 8.4.3 Hinted handoff · 8.5 Summary

What you learn in chapter 8 →

Chapter 9: Running ScyllaDB in production

9.1 Building a production cluster · 9.1.1 The config file · 9.1.2 Seeds · 9.1.3 Addresses · 9.1.4 Authentication · 9.1.5 Authorization · 9.1.6 Snitches · 9.2 Building your cluster · 9.2.1 Designing your cluster topology · 9.2.2 Computing your nodes · 9.2.3 Testing the cluster · 9.3 Managing the cluster · 9.3.1 Repairing a node · 9.3.2 Backing up your cluster · 9.3.3 Compacting a node · 9.3.4 Troubleshooting tables · 9.4 Managing the node lifecycle · 9.4.1 Stopping and starting a node · 9.4.2 Replacing a node · 9.4.3 Adding a node · 9.4.4 Removing a node · 9.5 Summary

What you learn in chapter 9 →

Chapter 10: Application development with ScyllaDB

10.1 Your application · 10.1.1 Python · 10.1.2 Virtual environments · 10.1.3 Flask · 10.2 Querying Scylla · 10.2.1 A new Scylla cluster · 10.2.2 Connecting to the cluster · 10.2.3 Your first application query · 10.3 Reading data · 10.3.1 Prepared statements · 10.3.2 Reading articles · 10.4 Writing data · 10.4.1 The necessary data · 10.4.2 Laying the write groundwork · 10.4.3 Batch-writing articles · 10.4.4 Working with user-defined types · 10.5 Configuring the driver · 10.5.1 Consistency · 10.5.2 Load balancing · 10.5.3 Retrying queries · 10.6 Authentication and authorization · 10.6.1 Enabling authentication and authorization · 10.6.2 Implementing role-based access control · 10.6.3 Authenticating via the app · 10.7 Summary

What you learn in chapter 10 →

Chapter 11: Monitoring ScyllaDB

11.1 The monitoring stack · 11.1.1 Deploying monitoring · 11.1.2 Prometheus · 11.1.3 Grafana · 11.1.4 Alertmanager · 11.1.5 Other monitoring needs · 11.2 Causing stress with cassandra-stress · 11.2.1 Setting up cassandra-stress · 11.2.2 Examining performance · 11.3 Common incidents · 11.3.1 A hot partition · 11.3.2 An overwhelmed database · 11.3.3 Failing to meet consistency requirements · 11.4 Summary

What you learn in chapter 11 →

Chapter 12: Moving data in bulk with ScyllaDB

12.1 Extracting data from ScyllaDB · 12.1.1 Using token ranges · 12.1.2 Change data capture · 12.2 Migrating to ScyllaDB · 12.2.1 Dual writing · 12.2.2 SSTableLoader · 12.2.3 Spark Migrator · 12.2.4 Writing a migrator · 12.2.5 Validating migrations · 12.3 Summary

What you learn in chapter 12 →

Concepts explained in this book

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.