Selective replication of data in cassandra?

I am wondering how I can implement a user data replication strategy in which I will have full control over how each record is replicated (can this be done by overriding Partitioner and / or ReplicatePlacementStrategy?).

I want to replicate only a few records, leaving the rest alone. So basically I want to say: "Replicate this record through ALL nodes" or "Replicate this record through only two nodes" or "Do not replicate records at all!"

If such a thing is not possible, is it easiest to just use the ONE / ALL / QUORUM / etc consistency levels when calling write in-code?

Obviously, I am new to Cassandra and have not completely wrapped my head around me. Any clarifications would be great!

+4
source share
1 answer

NetworkTopologyStrategy allows you to control this based on each key. If you really need a key, you need to override the calculateNaturalEndpoints method in your user strategy.

+3
source

Source: https://habr.com/ru/post/1333024/


All Articles