cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sachin Nikam <skni...@gmail.com>
Subject CQL 3.x Update ...USING TIMESTAMP...
Date Wed, 11 Mar 2015 05:45:34 GMT
I am planning to use the Update...USING TIMESTAMP... statement to make sure
that I do not overwrite fresh data with stale data while having to avoid
doing at least LOCAL_QUORUM writes.

Here is my table structure.

Table=DocumentStore
DocumentID (primaryKey, bigint)
Document(text)
Version(int)

If the service receives 2 write requests with Version=1 and Version=2,
regardless of the order of arrival, the business requirement is that we end
up with Version=2 in the database.

Can I use the following CQL Statement?

Update DocumentStore using <versionValue>
SET  Document=<documentValue>,
Version=<versionValue>
where DocumentID=<documentIDValue>;

Has anybody used something like this? If so was the behavior as expected?

Regards
Sachin

Mime
View raw message