You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Stack <st...@duboce.net> on 2011/07/01 08:22:53 UTC

Re: HBase region size

On Wed, Jun 29, 2011 at 10:08 PM, Florin P <fl...@yahoo.com> wrote:
>  We have the almost the same scenario as Aditya, but with some differences.
>  1. our files are documents in any format (xls, pdf, doc, html etc)
>  2. we are expecting to have more than 5 millions of these documents

This is not many docs.  Will your document set be steady-state once it hits 5M?

>  3. The size of them varies like this
>            70% from them have their length < 1MB
>            29% from them have their length between 1MB and 10 MB
>            1% from them have their length > 10MB (they can have also 100MB)

What David says above though Jack in his yfrog presentation today
talks of storing all images in hbase up to 5MB in size.

Karthick in his presentation at hadoop summit talked about how once
cells cross a certain size -- he didn't saw what the threshold was I
believe -- then only the metadata is stored in hbase and the content
goes to their "big stuff" system.

Try it I'd say.  If only a few instances of 100MB, HBase might be fine.


>  4. We have to index all these files
>  5. We have to extract some metadata from just a subset of them having as input a client key

One time or ongoing?

St.Ack

Re: HBase region size

Posted by Eric Charles <er...@u-mangate.com>.
Hi Andrew,
Thx for your replies.

I may give a try one day to this indirection layer if someone does not 
pick it before me :)

On 01/07/11 18:34, Andrew Purtell wrote:
>>> One reasonable way to handle native storage of large objects in HBase would
>>> be to introduce a layer of indirection.
>>
>> Do you see this layer on the client or on the server side?
>
>
> Client side.
>
>> I was also thinking on the "update": Le's say we store a new version of
>> the large object which is smaller than the previous one (less chunks).
>> The previously created chunks will remain for the TimeToLive, but could
>> be potentially removed. The indirection layer would be responsible for
>> this maintenance?
>
>
> Yes.
>
>>> Store the chunks in a manner that gets good distribution in the keyspace,
>>> maybe by SHA-1 hash of the content.
>>
>> An alternative would be to add a "_chunk#" to the original key value.
>> I guess you prefer to randomly distribute the chunks in the available
>> regions?
>
>
> Yes. This will increase the probability that a MultiAction<Get>  of the chunks is parallelized over multiple region servers. That would be beneficial for distributing load, but also if most or all of the chunks are in the same region -- as would be the case with appending "_chunk#" to the key -- then performance will suffer because they will be retrieved serially.
>
>> With "index", you mean a list of chunk keys?
>
>
> Yes.
>
>
>>> Storing the large ones in HDFS and simply having the pointer in HBase
>>> allows to benefit from HDFS streaming.
>>
>> I was wondering if it was already discussed on a StreamingPut
>> (StreamingGet)?
>
>
> The way HBase RPC currently works, it's not possible to stream data out of HBase. The objects that satisfy your Get or Scanner.next request are marshalled fully into the RPC response, which is sent all at once.
>
> You could use the HBase REST gateway and therefore stream the response through. In that case your client side access to the HBase cluster is via your favorite HTTP client library. But then your actions transit a gateway, which adds latency (and the gateway must buffer the objects fully in memory), and if addressing resources in a RESTful manner there are HTTP transaction overheads to consider. This type of configuration would work best for supporting user facing services that are RESTful in nature themselves: API services, websites.
>
>
> Best regards,
>
>
>    - Andy
>
> Problems worthy of attack prove their worth by hitting back. - Piet Hein (via Tom White)
>


-- 
Eric

Re: HBase region size

Posted by Andrew Purtell <ap...@apache.org>.
> > One reasonable way to handle native storage of large objects in HBase would 
> > be to introduce a layer of indirection.
> 
> Do you see this layer on the client or on the server side?


Client side.

> I was also thinking on the "update": Le's say we store a new version of 
> the large object which is smaller than the previous one (less chunks). 
> The previously created chunks will remain for the TimeToLive, but could 
> be potentially removed. The indirection layer would be responsible for 
> this maintenance?


Yes.

> > Store the chunks in a manner that gets good distribution in the keyspace, 
> > maybe by SHA-1 hash of the content.
> 
> An alternative would be to add a "_chunk#" to the original key value.
> I guess you prefer to randomly distribute the chunks in the available 
> regions?


Yes. This will increase the probability that a MultiAction<Get> of the chunks is parallelized over multiple region servers. That would be beneficial for distributing load, but also if most or all of the chunks are in the same region -- as would be the case with appending "_chunk#" to the key -- then performance will suffer because they will be retrieved serially.

> With "index", you mean a list of chunk keys?


Yes.


> > Storing the large ones in HDFS and simply having the pointer in HBase 
> > allows to benefit from HDFS streaming.
> 
> I was wondering if it was already discussed on a StreamingPut
> (StreamingGet)?


The way HBase RPC currently works, it's not possible to stream data out of HBase. The objects that satisfy your Get or Scanner.next request are marshalled fully into the RPC response, which is sent all at once.

You could use the HBase REST gateway and therefore stream the response through. In that case your client side access to the HBase cluster is via your favorite HTTP client library. But then your actions transit a gateway, which adds latency (and the gateway must buffer the objects fully in memory), and if addressing resources in a RESTful manner there are HTTP transaction overheads to consider. This type of configuration would work best for supporting user facing services that are RESTful in nature themselves: API services, websites.


Best regards,


  - Andy

Problems worthy of attack prove their worth by hitting back. - Piet Hein (via Tom White)


Re: HBase region size

Posted by Eric Charles <er...@u-mangate.com>.
On 01/07/11 10:23, Andrew Purtell wrote:
>> From: Stack<st...@duboce.net>
>
>>>   3. The size of them varies like this
>>>             70% from them have their length<  1MB
>>>             29% from them have their length between 1MB and 10 MB
>>>             1% from them have their length>  10MB (they can have also
>> 100MB)
>>
>> What David says above though Jack in his yfrog presentation today
>> talks of storing all images in hbase up to 5MB in size.
>>
>> Karthick in his presentation at hadoop summit talked about how once
>> cells cross a certain size -- he didn't saw what the threshold was I
>> believe -- then only the metadata is stored in hbase and the content
>> goes to their "big stuff" system.
>>
>> Try it I'd say.  If only a few instances of 100MB, HBase might be fine.
>
>
> I've seen problematic behavior in the past, if you store values larger than 100 MB and then do concurrent scans over table(s) containing many such objects. The default KeyValue size limit is 10 MB. This is usually sufficient. For webtable-like applications I may raise it to 50 MB, and larger objects are not interesting anyway (to me).
>
> One reasonable way to handle native storage of large objects in HBase would be to introduce a layer of indirection.

Do you see this layer on the client or on the server side?
(the considerations you expose a bit later on the round-trip between 
client and server does not allow me to identify it :)

> Break the large object up into chunks.

Chunk size could be configured.
I was also thinking on the "update": Le's say we store a new version of 
the large object which is smaller than the previous one (less chunks). 
The previously created chunks will remain for the TimeToLive, but could 
be potentially removed. The indirection layer would be responsible for 
this maintenance?

> Store the chunks in a manner that gets good distribution in the keyspace, maybe by SHA-1 hash of the content.

An alternative would be to add a "_chunk#" to the original key value.
I guess you prefer to randomly distribute the chunks in the available 
regions?

> Then store an index to the chunks with the key of your choice.

With "index", you mean a list of chunk keys?

> Get the key to retrieve the index, then use a MultiAction to retrieve the referenced chunks in parallel.
> Given large objects you are going to need a number of round trips over the network to pull all of the data anyway. Adding a couple more in the front may not cause the result to fall outside the performance bound of your application.
>
> However you will put your client under heap pressure that way, as objects in HBase are fully transferred at once to the client in the RPC response. Another option is to store large objects directly into HDFS and keep only the path to it in HBase. A benefit of this approach is you can stream the data out of HDFS with as little or as much buffering in your application as you would like.

Storing the large ones in HDFS and simply having the pointer in HBase 
allows to benefit from HDFS streaming.

I was wondering if it was already discussed on a StreamingPut 
(StreamingGet)?

Thx.

>
> Best regards,
>
>
>     - Andy
>
> Problems worthy of attack prove their worth by hitting back. - Piet Hein (via Tom White)


-- 
Eric

Re: HBase region size

Posted by Florin P <fl...@yahoo.com>.
Hello!
  Thank you for your responses. We are going to implement the solution with storing the metadata information on HBase and the content of the files
into HDFS map files. We'll keep the reference of the map file in the HBase.
Kind regards,
 Florin

--- On Fri, 7/1/11, Andrew Purtell <ap...@apache.org> wrote:

> From: Andrew Purtell <ap...@apache.org>
> Subject: Re: HBase region size
> To: "user@hbase.apache.org" <us...@hbase.apache.org>
> Date: Friday, July 1, 2011, 4:23 AM
> > From: Stack <st...@duboce.net>
> 
> >>  3. The size of them varies like this
> >>            70% from them have their length
> < 1MB
> >>            29% from them have their length
> between 1MB and 10 MB
> >>            1% from them have their length
> > 10MB (they can have also 
> > 100MB)
> > 
> > What David says above though Jack in his yfrog
> presentation today
> > talks of storing all images in hbase up to 5MB in
> size.
> > 
> > Karthick in his presentation at hadoop summit talked
> about how once
> > cells cross a certain size -- he didn't saw what the
> threshold was I
> > believe -- then only the metadata is stored in hbase
> and the content
> > goes to their "big stuff" system.
> > 
> > Try it I'd say.  If only a few instances of 100MB,
> HBase might be fine.
> 
> 
> I've seen problematic behavior in the past, if you store
> values larger than 100 MB and then do concurrent scans over
> table(s) containing many such objects. The default KeyValue
> size limit is 10 MB. This is usually sufficient. For
> webtable-like applications I may raise it to 50 MB, and
> larger objects are not interesting anyway (to me).
> 
> One reasonable way to handle native storage of large
> objects in HBase would be to introduce a layer of
> indirection. Break the large object up into chunks. Store
> the chunks in a manner that gets good distribution in the
> keyspace, maybe by SHA-1 hash of the content. Then store an
> index to the chunks with the key of your choice. Get the key
> to retrieve the index, then use a MultiAction to retrieve
> the referenced chunks in parallel. Given large objects you
> are going to need a number of round trips over the network
> to pull all of the data anyway. Adding a couple more in the
> front may not cause the result to fall outside the
> performance bound of your application.
> 
> However you will put your client under heap pressure that
> way, as objects in HBase are fully transferred at once to
> the client in the RPC response. Another option is to store
> large objects directly into HDFS and keep only the path to
> it in HBase. A benefit of this approach is you can stream
> the data out of HDFS with as little or as much buffering in
> your application as you would like.
>  
> Best regards,
> 
> 
>    - Andy
> 
> Problems worthy of attack prove their worth by hitting
> back. - Piet Hein (via Tom White)
> 

Re: HBase region size

Posted by Andrew Purtell <ap...@apache.org>.
> From: Stack <st...@duboce.net>

>>  3. The size of them varies like this
>>            70% from them have their length < 1MB
>>            29% from them have their length between 1MB and 10 MB
>>            1% from them have their length > 10MB (they can have also 
> 100MB)
> 
> What David says above though Jack in his yfrog presentation today
> talks of storing all images in hbase up to 5MB in size.
> 
> Karthick in his presentation at hadoop summit talked about how once
> cells cross a certain size -- he didn't saw what the threshold was I
> believe -- then only the metadata is stored in hbase and the content
> goes to their "big stuff" system.
> 
> Try it I'd say.  If only a few instances of 100MB, HBase might be fine.


I've seen problematic behavior in the past, if you store values larger than 100 MB and then do concurrent scans over table(s) containing many such objects. The default KeyValue size limit is 10 MB. This is usually sufficient. For webtable-like applications I may raise it to 50 MB, and larger objects are not interesting anyway (to me).

One reasonable way to handle native storage of large objects in HBase would be to introduce a layer of indirection. Break the large object up into chunks. Store the chunks in a manner that gets good distribution in the keyspace, maybe by SHA-1 hash of the content. Then store an index to the chunks with the key of your choice. Get the key to retrieve the index, then use a MultiAction to retrieve the referenced chunks in parallel. Given large objects you are going to need a number of round trips over the network to pull all of the data anyway. Adding a couple more in the front may not cause the result to fall outside the performance bound of your application.

However you will put your client under heap pressure that way, as objects in HBase are fully transferred at once to the client in the RPC response. Another option is to store large objects directly into HDFS and keep only the path to it in HBase. A benefit of this approach is you can stream the data out of HDFS with as little or as much buffering in your application as you would like.
 
Best regards,


   - Andy

Problems worthy of attack prove their worth by hitting back. - Piet Hein (via Tom White)