I'm currently thinking about the best way to handle customers all over the world with Cassandra. I assume I have got servers in America and Europe. Is there a mechanism to influence on which servers the data is stored? For a user in the US the data should be hosted on the american server and only one safe copy in Europe. In general I was thinking of UUIDs which can be identified as a certain location. For example if the last bit is set, it should be on a server in the US and otherwise in Europe. Then I was thinking auf writing a custom Partitioner, which assigns the value to a value within the range of the American servers. For example if it starts with the 00-7f is Europe and 80-ff is in America. So I could use a normal Murmur3 which sets the first bit based on the location information in the UUID. Can I influence the partition range of a certain server? Especially with virtual nodes this might get complicated, I think. Is there a way to achieve server location based partition selection like desired? How would you try to solve this problem?
Asked
Active
Viewed 68 times
1 Answers
1
Right now, you'd need to have different keyspaces for each region. Once that's done, you can set the replication strategy to NetworkTopologyStrategy
, and then use NTS to set the replication factor to match your expectation of data locality.
There's an open issue ( CASSANDRA-7306 ) which proposed adding the opportunity to control locality in the way you describe. Right now, there's no indication that it's close to working, or that it'll be implemented in the near future, so the de facto way to implement this is with NetworkTopologyStrategy
and configuring replication factor appropriately.

Jeff Jirsa
- 4,391
- 11
- 24