You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Kauzki Aranami <ka...@gmail.com> on 2010/03/13 07:51:47 UTC

About the replication strategy of Cassandra

Hi all. I am interested in the architecture of Cassandra.

Cassandra offers the replication policy such as "Rack Unaware" "Rack
Aware(within a datacenter)" "Datacenter Aware". It is necessary to
select these replication policies by the application.

The algorithm when the replication policy based on "Rack Aware(within
a datacenter)" and the "Datacenter Aware" strategy is selected might
be a little difficult. In Cassandra, Zookeeper was selected to the
election algorithm of the node that the system was using.


1. Please give notes the replication strategy of Cassandra is selected.


2. About the Zab protocol adopted with Zookeeper. The weak point of
the Paxos protocol of Chubby is a delay. Is the Zab protocol more
excellent than this Paxos protocol?


-----------------------------------------------------------
  Kazuki Aranami

 Twitter: http://twitter.com/kimtea
 http://d.hatena.ne.jp/kazuki-aranami/
 -----------------------------------------------------------

Re: About the replication strategy of Cassandra

Posted by Jonathan Ellis <jb...@gmail.com>.
On Sat, Mar 13, 2010 at 4:38 PM, Kauzki Aranami
<ka...@gmail.com> wrote:
> I want you to explain this "For "Rack Aware" and "Datacenter Aware"
> strategies the algorithm is slightly more involved.". Is there an
> algorithm corresponding to "Rack Aware" and "Datacenter Aware"?

>From http://wiki.apache.org/cassandra/Operations :

RackAwareStrategy: replica 2 is is placed in the first node along the
ring the belongs in another data center than the first; the remaining
N-2 replicas, if any, are placed on the first nodes along the ring in
the same rack as the first

More details on that page.

Re: About the replication strategy of Cassandra

Posted by Kauzki Aranami <ka...@gmail.com>.
>> Does each replication strategy of "Rack Unaware" "Rack Aware(within a
>> datacenter)" "Datacenter Aware" in Cassandra depend by the algorithm
>> adopted respectively?
>
> I still don't understand, sorry.



The description of the following document is quoted.



Cassandra provides various replication policies such as "Rack
Unaware", "Rack Aware" (within a datacenter) and "Datacenter Aware".
Replicas are chosen based on the replication policy chosen by the
application.

If certain application chooses "Rack Unaware" replication strategy
then the non-coordinator replicas are chosen by picking N-1 successors
of the coordinator on the ring. For "Rack Aware" and "Datacenter
Aware" strategies the algorithm is slightly more involved. Cassandra
system elects a leader amongst its nodes using a system called
Zookeeper.

Cassandra - A Decentralized Structured Storage System
http://www.cs.cornell.edu/projects/ladis2009/papers/lakshman-ladis2009.pdf



I want you to explain this "For "Rack Aware" and "Datacenter Aware"
strategies the algorithm is slightly more involved.". Is there an
algorithm corresponding to "Rack Aware" and "Datacenter Aware"? Can
Zookeeper be replaced?


> For ZK you should stick to one datacenter.  (you can still use
> RackAware for the, well, rack aware parts.)  ZK does multiple round
> trips for each write (think of it as 2pc) so it really does poorly
> across a wan.

ok, thanks!

-----------------------------------------------------------
  Kazuki Aranami

 Twitter: http://twitter.com/kimtea
 http://d.hatena.ne.jp/kazuki-aranami/
 -----------------------------------------------------------



2010/3/14 Jonathan Ellis <jb...@gmail.com>:
> On Sat, Mar 13, 2010 at 3:47 PM, Kauzki Aranami
> <ka...@gmail.com> wrote:
>> Does each replication strategy of "Rack Unaware" "Rack Aware(within a
>> datacenter)" "Datacenter Aware" in Cassandra depend by the algorithm
>> adopted respectively?
>
> I still don't understand, sorry.
>
>> For instance, what is the strategy recommended when Zookeeper is
>> adopted?A minimum speed of the line in the data center is anxious,
>> too.
>
> For ZK you should stick to one datacenter.  (you can still use
> RackAware for the, well, rack aware parts.)  ZK does multiple round
> trips for each write (think of it as 2pc) so it really does poorly
> across a wan.
>

Re: About the replication strategy of Cassandra

Posted by Jonathan Ellis <jb...@gmail.com>.
On Sat, Mar 13, 2010 at 3:47 PM, Kauzki Aranami
<ka...@gmail.com> wrote:
> Does each replication strategy of "Rack Unaware" "Rack Aware(within a
> datacenter)" "Datacenter Aware" in Cassandra depend by the algorithm
> adopted respectively?

I still don't understand, sorry.

> For instance, what is the strategy recommended when Zookeeper is
> adopted?A minimum speed of the line in the data center is anxious,
> too.

For ZK you should stick to one datacenter.  (you can still use
RackAware for the, well, rack aware parts.)  ZK does multiple round
trips for each write (think of it as 2pc) so it really does poorly
across a wan.

Re: About the replication strategy of Cassandra

Posted by Kauzki Aranami <ka...@gmail.com>.
>> 1. Please give notes the replication strategy of Cassandra is selected.
>
> Can you be more specific?


Does each replication strategy of "Rack Unaware" "Rack Aware(within a
datacenter)" "Datacenter Aware" in Cassandra depend by the algorithm
adopted respectively?


For instance, what is the strategy recommended when Zookeeper is
adopted?A minimum speed of the line in the data center is anxious,
too.


>> 2. About the Zab protocol adopted with Zookeeper. The weak point of
>> the Paxos protocol of Chubby is a delay. Is the Zab protocol more
>> excellent than this Paxos protocol?
>
> Facebook did some internal work on using ZK for replication strategy
> but that was not part of the open source release that became Apache
> Cassandra.  (And we'd rather keep Cassandra completely distributed, so
> no big deal. :)

ok :)

-----------------------------------------------------------
  Kazuki Aranami

 Twitter: http://twitter.com/kimtea
 http://d.hatena.ne.jp/kazuki-aranami/
 -----------------------------------------------------------



2010/3/13 Jonathan Ellis <jb...@gmail.com>:
> On Sat, Mar 13, 2010 at 12:51 AM, Kauzki Aranami
> <ka...@gmail.com> wrote:
>> 1. Please give notes the replication strategy of Cassandra is selected.
>
> Can you be more specific?
>
>> 2. About the Zab protocol adopted with Zookeeper. The weak point of
>> the Paxos protocol of Chubby is a delay. Is the Zab protocol more
>> excellent than this Paxos protocol?
>
> Facebook did some internal work on using ZK for replication strategy
> but that was not part of the open source release that became Apache
> Cassandra.  (And we'd rather keep Cassandra completely distributed, so
> no big deal. :)
>
> -Jonathan
>

Re: About the replication strategy of Cassandra

Posted by Jonathan Ellis <jb...@gmail.com>.
On Sat, Mar 13, 2010 at 12:51 AM, Kauzki Aranami
<ka...@gmail.com> wrote:
> 1. Please give notes the replication strategy of Cassandra is selected.

Can you be more specific?

> 2. About the Zab protocol adopted with Zookeeper. The weak point of
> the Paxos protocol of Chubby is a delay. Is the Zab protocol more
> excellent than this Paxos protocol?

Facebook did some internal work on using ZK for replication strategy
but that was not part of the open source release that became Apache
Cassandra.  (And we'd rather keep Cassandra completely distributed, so
no big deal. :)

-Jonathan