cql - Update Different Columns in One Row Concurrently in Cassandra -


in cassandra, if update different columns concurrently in 1 row, there write conflicts?

for example have table

create table foo (k text, text, b text, primary key (k)) 

one thread in code updates column a

insert foo (k, a) values ('hello', 'foo') 

while other thread updates column b

insert foo (k, b) values ('hello', 'bar'). 

when running concurrently, possible 2 queries arrive @ server @ same time.

could expect same result update 2 columns in 1 cql?

insert foo(k, a, b) values ('hello', 'foo', 'bar') 

will there write conflicts? each insertion atomic?


as tom mentioned in reply in cassandra, operations column-based. each column should have timestamp. in such case, above scenario not bring trouble given 1 thread update column a while other update column b. understanding correct?

thank you!

write conflicts resolved having each server track time of write. if arrive @ exact same time (with ms accuracy) cassandra pick 1 based on algorithm (not sure details, assume involves node uuids).

so write conflicts not need worry about. reducing 2 queries single 1 right thing.

of course important servers synchronized times, or funny things may happen.


Comments