Pergunta

As we all know, we have ConsistencyLevel of ReplicationFactor in cassandra. And we just want to leverge it for keeping data consistency. Because it is supposed to keep the price info.

So which strategy is better?

Write ALL Ensure that the write is written to all N replicas before responding to the client. Any unresponsive replicas will fail the operation

Read ALL Will query all replicas and return the record with the most recent timestamp once all replicas have replied. Any unresponsive replicas will fail the operation.

It seems write ALL is for sure the safest. But not sure if Read all is better? Any opinion about it of the pros and cons? Any other choice of nosql you think is better?

Foi útil?

Solução

"Better" depends on what you are trying to achieve. Using write or read at consistency level ALL means that your cluster will be unavailable for write (or read) if even one node is unresponsive.

Generally, writing and reading both at consistency level QUORUM is an effective balanced approach since it provides full consistency (you will never read an out-of-date value) but can also tolerate the failure of a minority of nodes.

But the "best" approach depends on your application and how much consistency you actually need. In particular, you can get better read and write performance (and better availability) if you can tolerate lower consistency.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top