Inside Cassandra – C* is an interesting piece of software for many reasons, but it is especially interesting in its use of elegant data structures and algorithms. This talk will focus on the data structures and algorithms that make C* such a scalable and performant database. We will walk along the write, read and delete paths exploring the low-level details of how each of these operations work. We will also explore some of the background processes that maintain availability and performance. The goal of this talk is to gain a deeper understanding of C* by exploring the low-level details of its implementation.
2. Overview
• To disk and back again
• Cassandra Internals by Aaron Morton
• Goals
– RDBMS comparison to C*
– Make educated decisions
I’m configuration
3. Node 3Node 2
Node 1Node 0
Distributed Hashing
A B
C D
E F
G H
I J
K L
M N
O P
Location = Hash(Key) % # Nodes
4. Node 4
Node 3Node 2
Node 1Node 0
Distributed Hashing
A B
C D
F G
H
K
J
LP
O
M
I
N
E
% Data Moved = 100 * N / (N + 1)
62. Delete
• Essentially a write (mutation)
• Data not remove immediately, but a
tombstone record added
• tombstone time > gc_grace = data removed
(compaction)
Today we’ll explore the path of your data through C* to the disk and from disk back out to your application. We discuss a lot of the processes, data formats and explore some of the data structures involved.I’m going to explore topics that I were hard for me to understand or I found interesting.I’m not going to talk about thrift or CQL 3 or then intermediate layers between there and C* writing/reading your data. If you have free time at night or on the weekend I highly recommend C* internals talk. Git clone the repo and follow along with his talk. He gives a good intro to exploring the source code. Warning: It’s like reading a Wikipedia article. You never know where you’re going to end up.
write_request_timeout_in_ms – memory pressure on coordinator node