Reputation: 43
I'm wondering how I can go about implementing a custom data replication strategy where I would have complete control over how each record gets replicated (can it be done by overriding the Partitioner and/or ReplicatePlacementStrategy?).
I want to be able to replicate only a select few records while leaving the rest alone. So, basically I want to say: "Replicate this record through ALL nodes" or "Replicate that record through only two nodes" or "Don't replicate the records at all!"
If such a thing is not possible, is the easiest thing then simply using the ONE/ALL/QUORUM/etc consistency levels when calling writes in-code?
Obviously, I'm new to Cassandra and haven't fully wrapped my head around it. Any clarification would be great!
Upvotes: 4
Views: 692
Reputation: 19377
NetworkTopologyStrategy lets you control this on a per-keyspace basis. If you really need it per-key, you'd need to override the calculateNaturalEndpoints method in a custom Strategy.
Upvotes: 3