cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ajaya Agrawal <>
Subject Re: Mutable primary key in a table
Date Sun, 08 Feb 2015 06:48:31 GMT
On Sun, Feb 8, 2015 at 5:03 AM, Eric Stevens <> wrote:

> I'm struggling to think of a model where it makes sense to update a
> primary key as a typical operation.  It suggests, as Adil said, that you
> may be reasoning wrong about your data model.  Maybe you can explain your
> problem in more detail - what kind of thing has you updating your PK on a
> regular basis?
> I have a 'user' table which has a column called 'user_name' and other
columns like name, city etc. The application requires that user_name be
unique and user should be searchable by 'user_name'. The only way to do
this in C* would be to make user_name column primary key. Things get
trickier when there is a requirement which says that user_name can be
changed by the users of the application. This a distributed application
which mean that it runs on multiple nodes. If I have to change user_name
atomically then either I need to implement distributed locking or use
something C* provides.

View raw message