incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charlie Mason <charlie....@gmail.com>
Subject Announcing OCM - The Object Cassandra Mapper
Date Sun, 21 Mar 2010 22:07:45 GMT
Hi All,

I am going to be using Cassandra for a project I am working on. To
enable me to use it more easily I have built a relatively simple ORM
to simplify access to Cassandra and to provide some extra
functionality. When I say ORM I am not talking about developing a
Hibernate for Cassandra, OCM is much more light weight than that and
tailored to the Cassandra data model.

It has a simple Specification file format that defines how you want to
map your data to objects in your chosen programming language.  This is
then fed into the OCM complier which generates a series of human
readable source files in the specified language. This combined with
base OCM library can be used by your app. It also generates the
storage-config.xml file for you.

Currently there is only a Java backend for the OCM complier, although
it should be relatively straight forward to add support for other
languages as all the code generation is done form simple Velocity
templates. The Java backend uses the Hector library to interface with
Cassandra and so benefits from load balancing and connection pooling.

OCM has a few extra features on top of basic CRUD style persistence:

Any column can be marked as Indexed. OCM automatically maintains a
secondary table mapping the column to the key of parent Column Family.
Changes made through OCM automatically update the index. It also
provides a static method in the Java language to obtain a row using
the indexed field e.g. usersByEmail for a standard user table with the
user id as the key.

Many2Many relationships can also be defined. These are implemented as
a Supper Column in both tables. OCM maintains both of these
automatically as and when they are updated or removed.

The Range Scanner provides a simple interface to obtain records by
scanning a accross a number of keys. It splits the range scan into a
number of range slice calls, so you can gradually progress through
very large scan ranges just be asking for the next row form OCM.


Its available under the Apache license on Git Hub.

http://github.com/charliem/OCM

Let me know what you think or if you have any questions. Contributions
are more than welcome if anyone else is interested in using it. Its
still a bit rough around the edges although most of the basic
functionality is working, at least for Java apps.


Charlie M

Mime
View raw message