incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan McCall <n...@vervewireless.com>
Subject Re: Using column plus value or only column?
Date Tue, 02 Feb 2010 19:41:02 GMT
If I understand you correctly, I think I have a decent example. I have
a ColumnFamily which models user preferences for a "site" in our
system:

UserPreferences : {
  123_EDD43E57589F12032AF73E23A6AF3F47 : {
    favorite_color : red,
    ...
  }
}

I structured it this way because we have a lot of "sites" to which a
user could create preferences for, so the site_id is prepended to the
value of a session_id therefore you always need two pieces of
information to enforce that a given record belongs to a specific
"site". The site_id is always an integer and the session_id is always
a 32 char string so sticking an underscore between them makes
validatable parsing and construction trivial. The bloom filtering
behind the key lookups also make checks for existence extremely fast.

Note: I feel compelled to mention this is not a typical use case that
I think would generally warrant anything outside of an RDBMS. However,
In our system writes to this preference "table" can burst up to
several thousand a second. Thus the need for the predictable write
performance of Cassandra.

Cheers,
Nate



On Tue, Feb 2, 2010 at 9:50 AM, Erik Holstad <erikholstad@gmail.com> wrote:
> Sorry that there are a lot of questions from me this week,  just trying to
> better understand
> the best way to use Cassandra :)
>
> Let us say that you know the length of your key, everything is standardized,
> are there people
> out there that just tag the value onto the key so that you don't have to pay
> the extra overhead
> of the second byte[]?
>
> --
> Regards Erik
>

Mime
View raw message