incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tyler Hobbs <ty...@riptano.com>
Subject Re: Consistency question caused by Read_all and Write_one
Date Tue, 14 Dec 2010 17:59:01 GMT
Could you give more details on what you're trying to do?  This sounds like a
case where a UUID will give you what you need without needing to lock.

- Tyler

On Tue, Dec 14, 2010 at 10:24 AM, Alvin UW <alvinuw@gmail.com> wrote:

> Thanks.
> It is very helpful.
>
> I think I'd like to write to the same column.
>
> Would you please give me more details about your last sentence? For
> example, why can't I use locking mechanism inside of cassandra?
>
> Thanks.
> Alvin
>
> 2010/12/13 Aaron Morton <aaron@thelastpickle.com>
>
> In your example is a little unclear.
>>
>>  If you are writing to a single row and creating columns with user names.
>> Then when you read all the columns for row 1 you will get columns called Dan
>> and Ken.
>>
>> If you are writing to the same column, let's say called user, then *if*
>> they are send with the same time stamp the greater value when compared by
>> bytes will be used. Ken in this case.
>>
>> If you app has sections that are highly concurrent try to design them
>> away, or use a locking mechanism outside of casandra, or use another DB.
>>
>> Hope that helps.
>> Aaron
>>
>>
>> On 14/12/2010, at 7:11 AM, Alvin UW <alvinuw@gmail.com> wrote:
>>
>> Yes, the same timestamp
>>
>> 2010/12/10 Ryan King < <ryan@twitter.com>ryan@twitter.com>
>>
>>> On Fri, Dec 10, 2010 at 12:49 PM, Alvin UW < <alvinuw@gmail.com>
>>> alvinuw@gmail.com> wrote:
>>> > Hello,
>>> >
>>> >
>>> > I got a consistency problem in Cassandra.
>>> >
>>> > Given a column family with a record:    Id   Name
>>> >                                                         1    David
>>> >
>>> > There are three backups for this column family.
>>> >
>>> > Assume there are two write operation happens issued by the same
>>> application
>>> > by this order: write_one("1", "Dan") ; write_one("1", "Ken").
>>> > What will Read_all("1") get?
>>> >
>>> > Assume the above two write operations happens exactly the same time in
>>> two
>>> > applications,
>>> > Again what will Read_all("1") get?
>>>
>>> By "exactly the same" do you mean "with the same timestamp"?
>>>
>>> -ryan
>>>
>>
>>
>

Mime
View raw message