Put all of the requests for a particular date together.

Today, you update the value for a particular user by appending to the
current value.  All you need to do is to change that slightly by appending
new data to the value for the user + the current date.

If you want to migrate your database gently, you can even start by having
the update find old style keys, do the old-style update and also split the
appended data into several new style keys.  When you finish writing all the
new style keys with the segmented data, delete the original.  If the update
fails before writing all the new keys, the next update will fix things.
 Updates should fail only rarely so you would have a very small number of
users with both kinds of keys.

It would be better to do a cataclysmic conversion using a map-reduce
program, but that may not be feasible.

On Thu, Jul 14, 2011 at 2:23 PM, Andre Reiter <a.rei...@web.de> wrote:

> ----- Original Message -----
>> From: Ted Dunning <tdunn...@maprtech.com>
>> Sent: Thu Jul 14 2011 23:17:20 GMT+0200 (CET)
>> To:
>> CC:
>> Subject: Re: data structure
>>
>
>  You can play tricks with the arrangement of the key.
>>
>> For instance, you can put date at the end of the key.  That would let you
>> pull data for a particular user for a particular date range.  The date
>> should not be a time stamp, but should be a low-res version of time
>> (day-level resolution might be ok) so that you can minimize number of
>> rows.
>>
>>
> hi Ted
>
> i do not see any way to put the date into the row key, there are many
> requests/impressions for a particular user (row key)
> so no chance to put a date into the key
>
> andre
>
>
>
>

Reply via email to