Please enable JavaScript.
Coggle requires JavaScript to display documents.
Architecture (Cluster (virtual node (each node is assigned multiple tokens…
Architecture
Cluster
-
-
-
-
virtual node
each node is assigned multiple tokens, each as a virtual node.
by default, a node contains 256 tokens/virtual nodes
-
-
-
coordinator node
client can talk to any node in the cluster ring, that is the coordinator node
coordinator node can find which nodes contains the requested data by hashing partition key to token, and query those nodes for data
Components
-
Mem Table
-
when reached threshold, data is stored to SSTable on disk
in native memory, not JVM heap
SSTable
immutable on-disk files, directory per keyspace-table
-
Tombstone
data to delete is marked by a tombstone,
and will be discarded while compaction
-
Bloom Filter
-
-
may be false-positive, but never false-negative
-
LightWeight Transaction
-
each tx has both a read and a write, as "compare and set"
if compare failed, current value is given to decide whether retry or abort
-
if a query is reading data from uncommited tx,
auto-commit that tx as part of read
Consistency Layer
-
Read
a coordinator node access min number of nodes
defined in consistent layer before return value to client
-
Write
a coordinator node access all nodes to replicate data, and regard as successful when received ack from given #nodes
-
Cache
key cache
map<partition key, row index entry>
-
-
-
-
Operations
-
Compaction
-
merge keys, combine columns, discard tombstones, create new indexes
-
Repair
Read repair
if insufficient replicas have latest data, immediately update to latest
-
Anti-Entropy repair
manual repair by running nodetool repair, causing a major compaction
-
-
Replication Strategy
-
hinted handoff
-
when the target node is back online, handoff the write request to it
-
hints do not count as write, except for consistency level = ANY
to avoid massive hints flushing the recovered target node, Cassandra limits storage of hints to a time window