Learning Apache Cassandra
eBook - ePub

Learning Apache Cassandra

Mat Brown

Condividi libro
  1. 246 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Learning Apache Cassandra

Mat Brown

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Learning Apache Cassandra è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Learning Apache Cassandra di Mat Brown in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Business e Business Intelligence. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2015
ISBN
9781783989201

Learning Apache Cassandra


Table of Contents

Learning Apache Cassandra
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Up and Running with Cassandra
What Cassandra offers, and what it doesn't
Horizontal scalability
High availability
Write optimization
Structured records
Secondary indexes
Efficient result ordering
Immediate consistency
Discretely writable collections
Relational joins
MapReduce
Comparing Cassandra to the alternatives
Installing Cassandra
Installing on Mac OS X
Installing on Ubuntu
Installing on Windows
Bootstrapping the project
CQL – the Cassandra Query Language
Interacting with Cassandra
Creating a keyspace
Selecting a keyspace
Summary
2. The First Table
Creating the users table
Structuring of tables
Table and column options
The type system
Strings
Integers
Floating point and decimal numbers
Dates and times
UUIDs
Booleans
Blobs
The purpose of types
Inserting data
Writing data does not yield feedback
Partial inserts
Selecting data
Missing rows
Selecting more than one row
Retrieving all the rows
Paginating through results
Developing a mental model for Cassandra
Summary
3. Organizing Related Data
A table for status updates
Creating a table with a compound primary key
The structure of the status updates table
UUIDs and timestamps
Working with status updates
Extracting timestamps
Looking up a specific status update
Automatically generating UUIDs
Anatomy of a compound primary key
Anatomy of a single-column primary key
Beyond two columns
Compound keys represent parent-child relationships
Coupling parents and children using static columns
Defining static columns
Working with static columns
Interacting only with the static columns
Static-only inserts
Static columns act like predefined joins
When to use static columns
Refining our mental model
Summary
4. Beyond Key-Value Lookup
Looking up rows by partition
The limits of the WHERE keyword
Restricting by clustering column
Restricting by part of a partition key
Retrieving status updates for a specific time range
Creating time UUID ranges
Selecting a slice of a partition
Paginating over rows in a partition
Counting rows
Reversing the order of rows
Reversing clustering order at query time
Reversing clustering order in the schema
Paginating over multiple partitions
Building an autocomplete function
Summary
5. Establishing Relationships
Modeling follow relationships
Outbound follows
Inbound follows
Storing follow relationships
Designing around queries
Denormalization
Looking up follow relationships
Unfollowing users
Using secondary indexes to avoid denormalization
The form of the single table
Adding a secondary index
Other uses of secondary indexes
Limitations of secondary indexes
Secondary indexes can only have one column
Secondary indexes can only be tested for equality
Secondary index lookup is not as efficient as primary key lookup
Summary
6. Denormalizing Data for Maximum Performance
A normalized approach
Generating the timeline
Ordering and pagination
Multiple partitions and read efficiency
Partial denormalization
Displaying the home timeline
Read performance and write complexity
Fully denormalizing the home timeline
Creating a status update
Displaying the home timeline
Write complexity and data integrity
Summary
7. Expanding Your Data Model
Viewing a table schema in cqlsh
Adding columns to tables
Deleting columns
Updating the existing rows
Updating multiple columns
Updating multiple rows
Removing a value from a column
Missing columns in Cassandra
Deleting specific columns
Syntactic sugar for deletion
Inserts, updates, and upserts
Inserts can overwrite existing data
Checking before inserting isn't enough
Another advantage of UUIDs
Conditional inserts and lightweight transactions
Updates can create new rows
Optimistic locking with conditional updates
Optimistic locking in action
Optimistic locking and accidental updates
Lightweight transactions have a cost
When lightweight transactions aren't necessary
Summary
8. Collections, Tuples, and User-defined Types
The problem with concurrent updates
Serializing the collection
Introducing concurrency
Collection columns and concurrent updates
Defining collection columns
Reading and writing sets
Advanced set manipulation
Removing values from a set
Sets and uniqueness
Collections and upserts
Using lists for ordered, nonunique values
Defining a list column
Writing a list
Discrete list manipulation
Writing data at a specific index
Removing elements from the list
Using maps to store key-value pairs
Writing a map
Updating discrete values in a map
Removing values from maps
Collections in inserts
Collections and secondary indexes
Secondary indexes on map columns
The limitations of collections
Reading discrete values from collections
Collection size limit
Reading a collection column from multiple rows
Performance of collection operations
Working with tuples
Creating a tuple column
Writing to tuples
Indexing tuples
User-defined types
Creating a user-defined type
Assigning a user-defined type to a column
Adding data to a user-defined column
Indexing and querying user-defined types
Partial selection of user-defined types
Choosing between tuples and user-defined types
Comparing data structures
Summary
9. Aggregating Time-Series Data
Recording discrete analytics observations
Using discrete analytics observations
Slicing and dicing our data
Recording aggregate analytics observations
Answering the right question
Precomputation versus read-time aggregation
The many possibilities for aggregation
The role of discrete observations
Recording analytics observations
Updating a counter column...

Indice dei contenuti