So I am not sure if you guys are familiar with OCM . Basically it is
an ORM for Cassandra. Been testing it
So I have created model that has the following object relationship.
OCM generates the code from this that allows me to do easy
programmatic query from Java to Cassandra.
Object1-(Many2Many)->Object2-(Many2Many)->Object3-(Many2Many)->Object4-
(Many2Many)->Node
So my app gets the NODE and tries to query the dependency relationship
from Node->Object4->Object3->Object2->Object1.
I have compared the performance between Cassandra(with OCM) vs DB2.
The result is not very encouraging since the DB2 performance is
showing at least 3X faster than Cassandra. DB2 basically is just a
single call with a number of inner joins ..
Looking at the code, I think we might get a better performance if
somehow we can do the joins between objects within Cassandra server
rather than the client side. Right now , I am basically doing the
following.
Node node = new Node(connection,"nodeidentifier");
node.loadInfo(); // going to the wire ...?
node.loadObject4(); // this goes to the wire too ..
object4Keys = node.getObject4().getColumns.keys();
while(object4Keys.hasNextElement)
{
object4Key = object4Key.nextElement();
object4 = node.getObject4().get(object4Key);
object4.loadInfo(); // this goes to the wire
too ..
object4.loadObject3(); // this goes to the wire too ..
object3Keys = object4.getObject3().getColumns.keys();
while(object3Keys.hasNextElement)
{
object3Key = object3Key.nextElement();
object3 = node.getObject4().get(object4Key);
object3.loadInfo(); // this goes to the wire too ..
object3.loadObject2(); // this goes to the wire too ..
...
..
... until you get object1//
}
I think there is a lot of going back and forth between the client and
cassandra and if we can only move the relationship joins to Cassandra
server I think we can minimize the latency and improve the overall
performance on the query.
Is there a way to do a join across ColumnFamilies in Cassandra ?