user3088914
user3088914

Reputation: 11

order of execution in cassandra batch

How do I maintain the order of execution of statements inside a batch in Cassandra? I am trying to insert a record and then update that same record in the second statement but it seems that the order is not being followed.

Upvotes: 0

Views: 693

Answers (1)

RussS
RussS

Reputation: 16576

Batches aren't really meant for ordering things time wise but if you wish to do that, what you need to do is add timestamps to each statement. Usually, a batch will give the same timestamp to all operations in that batch which can lead to the results you've witnessed so far. By explicitly time-stamping you can specify the order you want.

Upvotes: 4

Related Questions