Please enable JavaScript.
Coggle requires JavaScript to display documents.
Database (Cassandra (Data Modeling (No Joins (Joins on Client Side,…
Database
Cassandra
-
-
Notes
Best Practices
-
-
-
-
-
-
Performing joins on the client should be a very rare case; you really want to duplicate (denormalize) the data instead.
-
-
the goal is to design tables that can provide the data you need with queries that touch a single partition, or failing that, the minimum possible number of partitions
Important
Write operations are always sent to all replicas, regardless of consistency level. The consistency level simply controls how many responses the coordinator waits for before responding to the client.
Every mutation is timestamped (including deletes)
and a Last-Write-Wins Element-Set conflict-free
replicated data type for each CQL row is used
In the event of an unexpected shutdown, Cassandra can lose up to the sync period or more if the sync is delayed (periodic sync mode).
The more tokens you have, the higher the probability of an outage
The design of the primary key is extremely important, as it will determine how much data will be stored in each partition and how that data is organized on disk, which in turn will affect how quickly Cassandra processes reads.
think not only how the data is written, but also in terms of how the data will be queried by downstream use cases.
-
In an UPDATE statement, all updates within the same partition key are applied atomically and in isolation.
-
Tips and Tricks
Running “nodetool drain” before stopping Cassandra will write everything in the memtables to SSTables and remove the need to sync with the commitlogs on startup.
A general guideline is to keep number of values per partition to below 100,000 and disk space per partition to below 100MB.
-
-
-
-