On Mon, May 20, 2013 at 10:01 AM, Pinak Pani <nishant.has.a.question@gmail.com> wrote:
Assume NetworkTopologyStrategy. So, I wanted to know whether a data-center will contain all the keys?

This is the case:

CREATE KEYSPACE appKS
  WITH placement_strategy = 'NetworkTopologyStrategy'
  AND strategy_options={DC1:3, DC2:3};

Does DC1 and DC2 each contain complete database corpus? That is, if DC1 blows, will I get all the data from DC2? Assume RF = 1.


Your config sample isn't RF=1 it's RF=3.  That's what the DC1:3 and DC2:3 mean -- set RF=3 for DC1 and RF=3 for DC2 for all rows of all CFs in this keyspace.



 

Sorry, for the very elementary question. This is the post that made me ask this question: http://www.onsip.com/blog/2011/07/15/intro-to-cassandra-and-networktopologystrategy

It says,

"NTS creates an iterator for EACH datacenter and places writes discretely for each. The result is that NTS basically breaks each datacenter into it's own logical ring when it places writes."

A lot of things change in fast moving projects in 2 years, so you'll have to take anything written 2 years ago with a grain of salt and figure out if it's still true with whatever version you're using.


 

That seems to mean that each data-center behaves as an independent ring with initial_token. So, If I have 2 data centers and NTS, I am basically mirroring the database. Right?



Depending on how you've configured your placement strategy, but if you're using DC1:3 and DC2:3 like you have above, then yes, you'd expect to have 3 copies of every row in both data centers for that keyspace.

-Bryan