The Oslo Cassandra Users explored what is difficult to experience on a single-node Cassandra cluster, namely data consistency issues. That's why they got together to form a cluster of Cassandra nodes.
5. NappyShoper: data model
cart created time
keyspace
column
family
username
cart number
[default@meetup2_rf3] get shoppingcarts['user66021:1381150822598:2'];
=> (name=Libero, value=60 kroner, timestamp=1381150825320000)
=> (name=Pampers, value=70 kroner, timestamp=1381150825973000)
columns
7. Experiment 1. No replication
●
Choose keyspace with RF=1. Set Read to ONE and Write to ONE
●
Fill with Libero, checkout.
●
Unplug one node, checkout
●
Create new shoppingcarts
●
Set Write to ANY and fill with Libero. Checkout
●
Plug the node back and checkout
NB!:
–
CL.ANY – data stored just as Hinted Handoffs (couple of hours TTL)
8. Experiment 2. Replication. Eventual consistency
●
Choose keyspace with RF=2. Set Read to ONE and Write to ONE
●
Fill with Libero. Disconnect one node. Checkout
●
Fill with Pampers. Checkout
●
Disconnect one more node. Connect first node back. Checkout
●
Connect second node back. Checkout
9. Experiment 3. Strong consistency. One node down
●
Choose keyspace with RF=3. Set Read to QUORUM and Write to
QUORUM
●
Fill with Libero. Disconnect one node. Checkout
●
Fill with Pampers. Checkout
●
Disconnect one more node. Connect first node back. Checkout.
●
Disconnect first node, such that we have 2 nodes down. Checkout.
10. Experiment 4. Strong consistency. Two nodes down
●
Choose keyspace with RF=5. Set Read to QUORUM and Write to
QUORUM
●
Fill with Libero. Disconnect two nodes. Checkout
●
Fill with Pampers. Checkout
●
Disconnect two other nodes. Connect first two nodes node back.
Checkout.
11. Experiment 5. Datacenter setup. Datacenter down
●
Choose keyspace with RF=3(DC1),RF=3(DC2). Set Read to
LOCAL_QUORUM and Write to LOCAL_QUORUM
●
Fill with Libero. Disconnect one datacenter. Checkout
●
Fill with Pampers. Checkout
●
Disconnect one node. Checkout
●
Reconnect datacenters.
12. Experiment 6. Datacenter setup. Datacenters partitioning
●
●
●
Choose keyspace with RF=3(DC1),RF=3(DC2). Set Read to
LOCAL_QUORUM and Write to EACH_QUORUM
Fill with Libero. Disconnect one datacenter.
Checkout with the same username from a machine in another
datacenter
13. Final notes
●
C* Summit 2013: Eventual Consistency != Hopeful Consistency
http://www.youtube.com/watch?v=A6qzx_HE3EU
●
Datastax Java Driver 1.0.4 & 2.0.0-beta2 fails QUORUM operations
when nodes are coming back up after physical network failure
https://groups.google.com/a/lists.datastax.com/forum/#!topic/java-d
river-user/zo3yGrKbpWg
●
Astyanax 1.56.43 supports CQL3, but consistency is always ONE