Please enable JavaScript.
Coggle requires JavaScript to display documents.
Cassandra (Features (NoSQL, No Single point of failure, HA, Fast write,…
Cassandra
Features
-
No Single point of failure, HA
-
-
-
-
-
Components
-
-
-
CommitLog
crash-recovery, each write op is logged here
Mem-table
in-memory, after commitlog, data is written here
SSTable
a disk file, flushed from Mem-table when a threshold is met
Bloom filter
a special kind of cache,
determine if an elem belongs to a set,
accessed after each query
Attribute Types
-
Collection type
-
-
-
custom types are implemented like collection. in order to use in collection, use frozen<customType>
index
-
secondary index
each node maintain a copy of secondary index, thus expensive
-
-
-
Key
Partition key
manage data distribution across nodes, single partition will be on the same node
-
Primary key
PRIMARY KEY((partitionKey1, partitionKey2), clusterKey1, clusterKey2)
-
Architecture
No master node. All the nodes in a cluster play the same role.
Each node is independent and at the same time interconnected to other nodes.
Any node can be a proxy between client and the nodes holding wanted data
Each node in a cluster can accept read and write requests, regardless of where the data is actually located in the cluster.
When a node goes down, read/write requests can be served from other nodes in the network
-
Keyspace
-
-
Column Family
-
-
super column
-
map of sub-columns : map<byte[], column>
I/O
Read
read from mem-table, and check bloom filter to find the SSTable holding the data
-
Data Replication
if a node returns out-of-date value,
Cassandra will detect that and return most recent value instead.
a read-repair will be performed in backgroud to update the stale values