You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Deepika Khera <dk...@lyris.com> on 2012/03/19 18:49:25 UTC

Hbase Transactional support

Hi,

I have some map reduce jobs that write to Hbase. I am trying to pick a
library that could provide transactional support for Hbase. I looked at
Omid and hbase-trx .

Could you please provide me with a comparison between the two so I can
make the right choice. 
Are there any other ways to do this?

Thanks,
Deepika


 


Re: Thrift and coprocessors

Posted by Gary Helmling <gh...@gmail.com>.
Currently endpoint coprocessors are only callable via the java client.
 Please do open a JIRA describing what you would like to see here.  If
you'd like to try working up a patch, that would be even better!


On Mon, Mar 19, 2012 at 11:03 AM, Ben West <bw...@yahoo.com> wrote:
> Hi all,
>
> We use thrift to access HBase, and I've been playing around with endpoint coprocessors. I'm wondering how I can use thrift to access these - it seems like they're mostly supported with Java clients.
>
> So far, I've just been adding each function to the thrift schema and then manually editing the thrift server to run my coprocessor. Is there an easier way?
>
> If none currently exist, I can write up a JIRA.
>
> Thanks,
> -Ben

Thrift and coprocessors

Posted by Ben West <bw...@yahoo.com>.
Hi all,

We use thrift to access HBase, and I've been playing around with endpoint coprocessors. I'm wondering how I can use thrift to access these - it seems like they're mostly supported with Java clients.

So far, I've just been adding each function to the thrift schema and then manually editing the thrift server to run my coprocessor. Is there an easier way? 

If none currently exist, I can write up a JIRA.

Thanks,
-Ben

Re: Hbase Transactional support

Posted by Maysam Yabandeh <ma...@yahoo-inc.com>.
Sandy,

That is an excellent question. Snapshot Isolation is a strong guarantee that is supported by many transactional systems such as Oracle and Google Percolator. However, as you correctly pointed out, it is not serializable. We actually have looked into it and implemented a  version of Omid that provides serializability with a performance comparable to that of snapshot isolation. I am currently cleaning the code to make it ready for release on github.

If you are into the details of isolation levels, the core idea is to check for read-write conflicts instead of write-write conflicts. A paper explaining the details and proving that checking for read-write conflicts alone is sufficient for serializability is going to be presented in the next Eurosys conference.
"A Critique of Snapshot Isolation", http://eurosys2012.unibe.ch/program/conference

Cheers
- Maysam Yabandeh

On Mar 19, 2012, at 8:46 PM, Sandy Pratt wrote:

> Maysam,
> 
> I wasn't aware of Omid before this post, so thanks for sharing that.  I really like the approach and indeed our own implementation of transactions on HBase uses MVCC and optimistic concurrency control with a centralized transaction manager.  I think it's a great fit for HBase.
> 
> One question though.  You mention detection of write-write conflicts, but not write-read conflicts.   I'm guessing that this is because you're shooting for non-serializable snapshot isolation.  Why not detect write-read anomalies and get to serializable isolation (or at least closer to it)?  For example it seems like you could detect the write skew anomaly (described here http://en.wikipedia.org/wiki/Snapshot_isolation) by tracking a little more state in your Status Oracle.  Were you trying to reduce state or decentralize it or something?  Is there simply no need for that level of isolation?
> 
> Apologies if this is clear in the code, which I haven't yet read thoroughly.
> 
> Thanks,
> Sandy
> 
> 
>> -----Original Message-----
>> From: Maysam Yabandeh [mailto:maysam@yahoo-inc.com]
>> Sent: Monday, March 19, 2012 11:45
>> To: user@hbase.apache.org
>> Subject: Re: Hbase Transactional support
>> 
>> Hi Deepika,
>> 
>> Omid provides Snapshot Isolation (SI), which is a well-known isolation
>> guarantee in database systems such as Oracle. In short, each transaction
>> reads from a consistent snapshot that does not include partial changes by
>> concurrent (or failed) transactions. SI also prevents write-write conflicts
>> between concurrent transactions. The overhead of Omid on HBase is
>> negligible and does not require any changes into HBase, with the only
>> exception of HBase garbage collection algorithm that is replaced via a
>> coprocessor. hbase-trx, on the other hand, does not provide read snapshots
>> and is not safe with client failures. You can find a more detailed comparison in
>> the Omid wiki page:
>> https://github.com/yahoo/omid/wiki
>> 
>> Cheers
>> - Maysam Yabandeh
>> 
>> On Mar 19, 2012, at 6:49 PM, Deepika Khera wrote:
>> 
>>> Hi,
>>> 
>>> I have some map reduce jobs that write to Hbase. I am trying to pick a
>>> library that could provide transactional support for Hbase. I looked
>>> at Omid and hbase-trx .
>>> 
>>> Could you please provide me with a comparison between the two so I can
>>> make the right choice.
>>> Are there any other ways to do this?
>>> 
>>> Thanks,
>>> Deepika
>>> 
>>> 
>>> 
>>> 
> 


RE: Hbase Transactional support

Posted by Sandy Pratt <pr...@adobe.com>.
Maysam,

I wasn't aware of Omid before this post, so thanks for sharing that.  I really like the approach and indeed our own implementation of transactions on HBase uses MVCC and optimistic concurrency control with a centralized transaction manager.  I think it's a great fit for HBase.

One question though.  You mention detection of write-write conflicts, but not write-read conflicts.   I'm guessing that this is because you're shooting for non-serializable snapshot isolation.  Why not detect write-read anomalies and get to serializable isolation (or at least closer to it)?  For example it seems like you could detect the write skew anomaly (described here http://en.wikipedia.org/wiki/Snapshot_isolation) by tracking a little more state in your Status Oracle.  Were you trying to reduce state or decentralize it or something?  Is there simply no need for that level of isolation?

Apologies if this is clear in the code, which I haven't yet read thoroughly.

Thanks,
Sandy


> -----Original Message-----
> From: Maysam Yabandeh [mailto:maysam@yahoo-inc.com]
> Sent: Monday, March 19, 2012 11:45
> To: user@hbase.apache.org
> Subject: Re: Hbase Transactional support
> 
> Hi Deepika,
> 
> Omid provides Snapshot Isolation (SI), which is a well-known isolation
> guarantee in database systems such as Oracle. In short, each transaction
> reads from a consistent snapshot that does not include partial changes by
> concurrent (or failed) transactions. SI also prevents write-write conflicts
> between concurrent transactions. The overhead of Omid on HBase is
> negligible and does not require any changes into HBase, with the only
> exception of HBase garbage collection algorithm that is replaced via a
> coprocessor. hbase-trx, on the other hand, does not provide read snapshots
> and is not safe with client failures. You can find a more detailed comparison in
> the Omid wiki page:
> https://github.com/yahoo/omid/wiki
> 
> Cheers
> - Maysam Yabandeh
> 
> On Mar 19, 2012, at 6:49 PM, Deepika Khera wrote:
> 
> > Hi,
> >
> > I have some map reduce jobs that write to Hbase. I am trying to pick a
> > library that could provide transactional support for Hbase. I looked
> > at Omid and hbase-trx .
> >
> > Could you please provide me with a comparison between the two so I can
> > make the right choice.
> > Are there any other ways to do this?
> >
> > Thanks,
> > Deepika
> >
> >
> >
> >


Re: Hbase Transactional support

Posted by Stack <st...@duboce.net>.
On Mon, Mar 19, 2012 at 11:44 AM, Maysam Yabandeh <ma...@yahoo-inc.com> wrote:
> hbase-trx, on the other hand, does not provide read snapshots and is not safe with client failures.

hbase-trx, https://github.com/hbase-trx/hbase-transactional-tableindexed,
has not been updated in over a year.
St.Ack

Re: Hbase Transactional support

Posted by Maysam Yabandeh <ma...@yahoo-inc.com>.
Deepika,

It is up to  you to decide the granularity of transactions, whether at the reduce level or at the M/R job level. Your application just need to be able to (efficiently) rerun the transaction in case of an abort. The transaction feature provides your application with two good properties: (i) ignoring the partial changes made by failed clients, (ii) providing isolation between concurrent transactions. I guess what you need from transactions in a M/R job is the former. This is because when the write set of transactions are large, the probability of write-write conflict between two transactions goes high and it becomes hard to get some progress with so many aborts. If you are planning to run long transactions (with large write sets) in parallel, avoiding write-write conflicts should be taken care of at the application layer by having the concurrent transactions to write to different data elements. In this case, Omid could also be optimized by disabling the submission of ids of the write set to the status oracle.

Cheers
- Maysam Yabandeh

On Mar 20, 2012, at 2:13 AM, Deepika Khera wrote:

Thanks Maysam. I am trying out Omid to see if it will fit my needs.

As I told you I am writing to hbase from a map reduce jobs. If my commit
and rollback is around a reducer task then it will be quite straight
forward. But if the commit should happen if all tasks of the M/R job
succeed(which is what I would want, because if some reducer tasks
succeed and some fail, it will not be possible to rerun partial data),
it gets tricky.
Am I on the wrong track?

Thanks,
Deepika

On Mon, 2012-03-19 at 11:44 -0700, Maysam Yabandeh wrote:
Hi Deepika,

Omid provides Snapshot Isolation (SI), which is a well-known isolation guarantee in database systems such as Oracle. In short, each transaction reads from a consistent snapshot that does not include partial changes by concurrent (or failed) transactions. SI also prevents write-write conflicts between concurrent transactions. The overhead of Omid on HBase is negligible and does not require any changes into HBase, with the only exception of HBase garbage collection algorithm that is replaced via a coprocessor. hbase-trx, on the other hand, does not provide read snapshots and is not safe with client failures. You can find a more detailed comparison in the Omid wiki page:
https://github.com/yahoo/omid/wiki

Cheers
- Maysam Yabandeh

On Mar 19, 2012, at 6:49 PM, Deepika Khera wrote:

Hi,

I have some map reduce jobs that write to Hbase. I am trying to pick a
library that could provide transactional support for Hbase. I looked at
Omid and hbase-trx .

Could you please provide me with a comparison between the two so I can
make the right choice.
Are there any other ways to do this?

Thanks,
Deepika









Re: Hbase Transactional support

Posted by Deepika Khera <dk...@lyris.com>.
Thanks Maysam. I am trying out Omid to see if it will fit my needs.

As I told you I am writing to hbase from a map reduce jobs. If my commit
and rollback is around a reducer task then it will be quite straight
forward. But if the commit should happen if all tasks of the M/R job
succeed(which is what I would want, because if some reducer tasks
succeed and some fail, it will not be possible to rerun partial data),
it gets tricky. 
Am I on the wrong track?

Thanks,
Deepika

On Mon, 2012-03-19 at 11:44 -0700, Maysam Yabandeh wrote:
> Hi Deepika,
> 
> Omid provides Snapshot Isolation (SI), which is a well-known isolation guarantee in database systems such as Oracle. In short, each transaction reads from a consistent snapshot that does not include partial changes by concurrent (or failed) transactions. SI also prevents write-write conflicts between concurrent transactions. The overhead of Omid on HBase is negligible and does not require any changes into HBase, with the only exception of HBase garbage collection algorithm that is replaced via a coprocessor. hbase-trx, on the other hand, does not provide read snapshots and is not safe with client failures. You can find a more detailed comparison in the Omid wiki page:
> https://github.com/yahoo/omid/wiki
> 
> Cheers
> - Maysam Yabandeh
> 
> On Mar 19, 2012, at 6:49 PM, Deepika Khera wrote:
> 
> > Hi,
> > 
> > I have some map reduce jobs that write to Hbase. I am trying to pick a
> > library that could provide transactional support for Hbase. I looked at
> > Omid and hbase-trx .
> > 
> > Could you please provide me with a comparison between the two so I can
> > make the right choice. 
> > Are there any other ways to do this?
> > 
> > Thanks,
> > Deepika
> > 
> > 
> > 
> > 
> 



Re: Hbase Transactional support

Posted by Maysam Yabandeh <ma...@yahoo-inc.com>.
Hi Deepika,

Omid provides Snapshot Isolation (SI), which is a well-known isolation guarantee in database systems such as Oracle. In short, each transaction reads from a consistent snapshot that does not include partial changes by concurrent (or failed) transactions. SI also prevents write-write conflicts between concurrent transactions. The overhead of Omid on HBase is negligible and does not require any changes into HBase, with the only exception of HBase garbage collection algorithm that is replaced via a coprocessor. hbase-trx, on the other hand, does not provide read snapshots and is not safe with client failures. You can find a more detailed comparison in the Omid wiki page:
https://github.com/yahoo/omid/wiki

Cheers
- Maysam Yabandeh

On Mar 19, 2012, at 6:49 PM, Deepika Khera wrote:

> Hi,
> 
> I have some map reduce jobs that write to Hbase. I am trying to pick a
> library that could provide transactional support for Hbase. I looked at
> Omid and hbase-trx .
> 
> Could you please provide me with a comparison between the two so I can
> make the right choice. 
> Are there any other ways to do this?
> 
> Thanks,
> Deepika
> 
> 
> 
>