-Re: HBase Key Design : Doubt
Doug Meil 2012-10-10, 19:32
If you do 2 Puts for row key A-B-C-D on different days, the second Put
logically replaces the first and the earlier Put becomes a previous
version. Unless you specifically want older versions, you won't get them
in either Gets or Scans.
Definitely want to read thisŠ
See this for more information about they internal KeyValue structure.
Older versions are kept around as long as the table descriptor says so
(e.g., max versions). See the StoreFile and Compactions entries in the
RefGuide for more information on the internals.
On 10/10/12 3:24 PM, "Jerry Lam" <[EMAIL PROTECTED]> wrote:
>correct me if I'm wrong. The version applies to the individual cell (ie.
>row key, column family and column qualifier) not (row key, column family).
>On Wed, Oct 10, 2012 at 3:13 PM, Narayanan K <[EMAIL PROTECTED]>
>> Hi all,
>> I have a usecase wherein I need to find the unique of some things in
>> across dates.
>> Say, on 1st Oct, A-B-C-D appeared, hence I insert a row with rowkey :
>> On 2nd Oct, I get the same value A-B-C-D and I don't want to redundantly
>> store the row again with a new rowkey - A-B-C-D for 2nd Oct
>> i.e I will not want to have 20121001-A-B-C-D and 20121002-A-B-C-D as 2
>> rowkeys in the table.
>> Eg: If I have 1st Oct , 2nd Oct as 2 column families and if number of
>> versions are set to 1, only 1 row will be present in for both the dates
>> having rowkey A-B-C-D.
>> Hence if I need to find unique number of times A-B-C-D appeared during
>> 1 and Oct 2, I just need to take rowcount of the row A-B-C-D by
>> over the 2 column families.
>> Similarly, if we have 10 date column families, and I need to scan only
>> 2 dates, then it scans only those store files having the specified
>> families. This will make scanning faster.
>> But here the design problem is that I cant add more column families to
>> table each day.
>> I would need to store data every day and I read that HBase doesnt work
>> with more than 3 column families.
>> The other option is to have one single column family and store dates as
>> qualifiers : date:d1, date:d2.... But here if there are 30 date
>> under date column family, to scan a single date qualifier or may be
>> of 2-3 dates will have to scan through the entire data of all d1 to d30
>> qualifiers in the date column family which would be slower compared to
>> having separate column families for the each date..
>> Please share your thoughts on this. Also any alternate design
>> you might have.