incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charlie Mason <charlie....@gmail.com>
Subject Re: Announcing OCM - The Object Cassandra Mapper
Date Mon, 22 Mar 2010 09:38:41 GMT
On Mon, Mar 22, 2010 at 8:35 AM, Ran Tavory <rantav@gmail.com> wrote:
> This looks very interesting, thank for contributing and I'm glad you found
> hector useful :)

Thanks, Hector has been very useful.

> You mention indexing - iirc, cassandra is adding this as an internal feature
> in 0.7.0, just fyi (and if I'm not mistaken). But I'm also wondering, how do
> you deal with consistency here? For example, what if a value was written
> successfully but writing the index failed? The word "transaction" comes to
> mind, but I feel like transactions are a bit odd to cassandra's spirit, so I
> was wondering what's your take on it?

The consistency is the same as the Cassandra constancy, fairly weak at
least from the view point of traditional ACID DBs. For my purposes the
very rare occurrence like that is not really going to be an issue,
although I can imagine. All the clients are likely to be Servers who
are up 24/7 so its only going to occur when there's an issue. If
there's built in support coming in 0.7 then I will update it to
support native indexs.

Transactions would be brilliant but I think its very difficult to do
and still keep the same scale out features of Cassandra. I know
Google's DataStore API manages it with Big Table, but I think Big
table has support for atomic updates from their non distributed master
architecture. There's an interesting Google IO video on You Tube about
the subject which is well worth watching.

I am not really trying to implement all the features of a traditional
DB like MySQL. I am just trying to automate some of common extra work
using Cassandra often requires the client application to do. Its far
better to implement things like updating indexes once correctly than
to have to remember to implement it everywhere you might update that
column.


Charlie M

> On Mon, Mar 22, 2010 at 12:07 AM, Charlie Mason <charlie.mas@gmail.com>
> wrote:
>>
>> 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