I have a very similar use case in my system, I've solved it as follows;

If all your users have a unique id, such as a login userid.
You could create a new column family, keyed by the userid, and add columns
which have no value, but the column name is the tag value.

Searching these tags later will be much simpler, as you can find them later
using a range slice, and are idempotent as each column contain only one tag.

Hope that makes sense :-)

--Jools



On 22 December 2010 12:54, Prasad Sunkari <s.pra...@gmail.com> wrote:

>
> Hi all,
>
> I have a column family for users of my system and I need to have tags set
> to these users.  My current plan is to have a column that holds a string
> (comma separated tags).
>
> I am not clear if this the best way to do it.  Specially because this may
> lead to a complications when more than one administrator is trying to tag
> the same user (lost updates) as well as the secondary indexes (if I wanted
> to use the built in secondary indexes).  I also am not sure if it is
> possible to have a secondary index on a multi-valued column!
>
> Another alternative is to have it in a super column with each tag being a
> column by itself and let my application take care of the secondary indexes.
>
> I am currently of the opinion that the second solution is the only thing
> that I could do.
> Any suggestions?  Since this is my first app on Cassandra I am trying to
> see if my opinion is correct.
>
> Thanks,
> Prasad
>

Reply via email to