Embedding Custom Replication Strategy in Cassandra

2014-04-13 Thread Rahul R
I am trying to develop a custom replication algorithm which replicates the
object based on its access patterns. That means, the remote replica which
is decided by the NetworkTopologyAware Strategy will need to be

1. Dynamic in Nature (afaik, the objects are statically allocated to a
particular node in the DHT and replica is placed to a node in a subsequent
node in the ring which will be mostly a node in some other DC ) . I intend
to change this at run time by changing the object location without
compromising the consistency guarantees.

The main motive is to place the objects closer to user. With my limited
knowledge on cassandra, I am not sure how to achieve the same. thus, I was
wondering on how to implement the same by overriding
NetworkTopologyAware
class
file in java,

Any suggestion ? I want to know how ridiculous this idea is ? how feasible
is it , is there any other alternative to achieve the same ?

Looking for  criticisms.


./Rahul


Re: Embedding Custom Replication Strategy in Cassandra

2014-04-13 Thread Rahul R
Hey Jonathan,

Could you give me an example ? I guess my peanut size brain is not able to
comprehend it. The idea is If I have an object lets say


Initially placed in EastCoast DC and replicated to WestCoast DC.(since RF =
2)

Now, I observe that the read request for the same  is increasing
in Ireland. The data should be automatically be replicated to Ireland DC
and the next closes DC(s) (in this case it could be just the WestCoast DC)
depending on the RF value.

It will be awesome , if I could configure cassandra in a way to achieve the
same effect. That ll subvert burden of coding the replication strategy. if
not, I will probably need to code it. In that case, it will be of great
help, if you could point out which methods I need to reimplement and
methods I need to be very cautious while implementing it.

Hopefully, I have not confused you enough.

./Rahul



On Sun, Apr 13, 2014 at 10:36 PM, Jonathan Ellis  wrote:

> Replica placement must be determined only by the key, otherwise you
> won't know where to look at read time.  If your scheme is doable with
> that restriction then you should be able to make it work.
>
> On Sun, Apr 13, 2014 at 9:20 PM, Rahul R  wrote:
> > I am trying to develop a custom replication algorithm which replicates
> the
> > object based on its access patterns. That means, the remote replica which
> > is decided by the NetworkTopologyAware Strategy will need to be
> >
> > 1. Dynamic in Nature (afaik, the objects are statically allocated to a
> > particular node in the DHT and replica is placed to a node in a
> subsequent
> > node in the ring which will be mostly a node in some other DC ) . I
> intend
> > to change this at run time by changing the object location without
> > compromising the consistency guarantees.
> >
> > The main motive is to place the objects closer to user. With my limited
> > knowledge on cassandra, I am not sure how to achieve the same. thus, I
> was
> > wondering on how to implement the same by overriding
> > NetworkTopologyAware<
> https://github.com/QwertyManiac/cassandra-cdh4/blob/master/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java
> >
> > class
> > file in java,
> >
> > Any suggestion ? I want to know how ridiculous this idea is ? how
> feasible
> > is it , is there any other alternative to achieve the same ?
> >
> > Looking for  criticisms.
> >
> >
> > ./Rahul
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder, http://www.datastax.com
> @spyced
>