You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Eric tamme <et...@gmail.com> on 2011/08/30 12:30:38 UTC

asynchronous writes (aka consistency = 0)

Is there any mechanism that would allow me to write to Cassandra with
no blocking at all?

I spent a long time figuring out a problem I encountered with one node
in each datacenter: LA, and NY using SS RF=1 and write consistency 1.
My row keys are yyyy-mm-dd-h so basically for every hour a row would
pin to one datacenter and I would get fast writes from one location.
This would change periodically as the hour changed (took forever to
figure out what was going on).

The whole point of switching to SS from NTS was so I could reduce data
redundancy (this is basically throw away data), but the delay in
writing cross country is too high with SS since the minimum
consistency will cause cassandra blocks to ensure there is ONE write
(assuming all nodes are up).

NTS does allow me to localize the block on writes by doing strategy
options NY=1,LA=1.. but then I am back to storing duplicate data.  I'd
like to be able to use SS with RF1 and write consistency=0 (or some
thing like that).

Any thoughts?

Re: asynchronous writes (aka consistency = 0)

Posted by Jonathan Ellis <jb...@gmail.com>.
On Tue, Aug 30, 2011 at 6:54 AM, Sylvain Lebresne <sy...@datastax.com> wrote:
> If you don't want to wait for the write to be applied by Cassandra before
> doing something else, then you can do that easily[1] client side.

Right.

Also consider that if you did have local replicas in each DC you could
get low-latency reads from that as well.  Cassandra is designed to
trade some replication overhead for latency and reliability; generally
you're better served by accepting that instead of fighting it. :)

-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com

Re: asynchronous writes (aka consistency = 0)

Posted by Sylvain Lebresne <sy...@datastax.com>.
There used to be a ZERO consistency level but it was removed because
it was harming more people than it was helping.

If what you want is very high availability, i.e. being able to write even
if the sole replica (in your RF=1 case) is down, then what you want to
use is CL ANY.

If you don't want to wait for the write to be applied by Cassandra before
doing something else, then you can do that easily[1] client side.

[1] if you are a php user, you may want to remove the word easily from
the sentence.

--
Sylvain

On Tue, Aug 30, 2011 at 12:30 PM, Eric tamme <et...@gmail.com> wrote:
> Is there any mechanism that would allow me to write to Cassandra with
> no blocking at all?
>
> I spent a long time figuring out a problem I encountered with one node
> in each datacenter: LA, and NY using SS RF=1 and write consistency 1.
> My row keys are yyyy-mm-dd-h so basically for every hour a row would
> pin to one datacenter and I would get fast writes from one location.
> This would change periodically as the hour changed (took forever to
> figure out what was going on).
>
> The whole point of switching to SS from NTS was so I could reduce data
> redundancy (this is basically throw away data), but the delay in
> writing cross country is too high with SS since the minimum
> consistency will cause cassandra blocks to ensure there is ONE write
> (assuming all nodes are up).
>
> NTS does allow me to localize the block on writes by doing strategy
> options NY=1,LA=1.. but then I am back to storing duplicate data.  I'd
> like to be able to use SS with RF1 and write consistency=0 (or some
> thing like that).
>
> Any thoughts?
>