We are planning to use apache shiro & cassandra for distributed session management very similar to mentioned @ https://github.com/lhazlewood/shiro-cassandra-sample
Need advice on deployment for cassandra in Amazon EC2:
In EC2, we have below setup: Single region, 2 Availability Zones(AZ), 4 Nodes
Accordingly, cassandra is configured:
Single DataCenter: DC1
two Racks: Rack1, Rack2
4 Nodes: Rack1_Node1, Rack1_Node2, Rack2_Node1, Rack2_Node2
Data Replication Strategy used is NetworkTopologyStrategy
Since Cassandra is used as session datastore, we need high consistency and availability.
My Questions:
- How many replicas shall I keep in a cluster? Thinking of 2 replicas, 1 per rack.
- What shall be the consistency level(CL) for read and write operations? Thinking of QUORUM for both read and write, considering 2 replicas in a cluster.
- In case 1 rack is down, would Cassandra write & read succeed with the above configuration? I know it can use the hinted-hands-off for temporary down node, but does it work for both read/write operations?
- Any other suggestion for my requirements?