Database Reference
In-Depth Information
Cassandra generate one for you. The representation of the token is dependent on the kind of
partitioner used.
applying
an
MD5
hash
on
keys.
This
is
represented
by
the
org.apache.cassandra.dht.BigIntegerToken
class.
With an
Order-Preserving Partitioner
,
the token is a UTF-8 string, based on the key. This is
represented by the
org.apache.cassandra.dht.StringToken
class.
Tokens are represented in Cassandra by the
org.apache.cassandra.dht.Token
class.
Tombsttone
Cassandra does not immediately delete data following a delete operation. Instead, it marks
the data with a “tombstone,” an indicator that the column has been deleted but not removed
entirely yet. The tombstone can then be propagated to other replicas.
Tombstones are discarded on major
Compaction
.
Vecttor C
r Cllock
Vector clocks allow for partial, causal ordering of events in a distributed system. A vector
clock maintains an array of logical clocks, one for each process, and each process contains a
local copy of the clock.
In order to keep the entire set of processes in a consistent logical state, one process will send
its clock to another process, which is then updated. In order to ensure consistency, some ver-
sion of the following steps are typically followed.
All clocks start at 0. Each time a process experiences an event, its clock is incremented by 1.
Each time a process prepares to send a message, this too counts as an event, so it increments
its clock by 1 and then sends its entire vector to the external process along with the message.
Each time a process receives a message, this too counts as an event, so it updates its own
clock by 1 and then compares its vector to the vector wrapped in the incoming message from
the external process. It updates its own clock with the maximum value from the comparison.
A vector clock event synchronization strategy will likely be introduced in a future version of
Cassandra.
Weak C
k Consiisttency
For reads, weak consistency improves performance by first returning results, and afterward
performing any necessary
Read Repair
.