Hayley Guillou
Hayley Guillou

Reputation: 3973

Cassandra writes - How many nodes?

I'm probably just missing something here, but my search terms have all been to general to get meaningful results.

Assume RF = Replication Factor

When I write a value to the database, does it write the value to RF nodes or does it write it to one node and replicate it RF nodes?

Upvotes: 3

Views: 272

Answers (2)

Brandon
Brandon

Reputation: 39182

If your question is really "how many nodes eventually have a copy of the data I write", then the answer is RF, not RF+1.

RF=1 means you have no redundancy and only have a single copy of your data.

Upvotes: 2

rodolk
rodolk

Reputation: 5907

That depends on the request you send. In the write request you can specify the consistency level:

  • ALL: it will write to all RF nodes before returning
  • QUORUM: it will write to a quorum of nodes before returning
  • ONE: it writes to one node before returning. After returning it waits response from RF-1 nodes.
  • LOCAL_QUORUM

...

See other possible values here: http://docs.datastax.com/en/cassandra/2.0/cassandra/dml/dml_config_consistency_c.html

Eventually all RF nodes will have the written data.

Upvotes: 4

Related Questions