cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ali Akhtar <>
Subject Consistency when adding data to collections concurrently?
Date Sat, 12 Nov 2016 10:34:24 GMT
I have a table where each record contains a list<string> of labels.

I have an endpoint which responds to new labels being added to a record by
the user.

Consider the following scenario:

- Record X, labels = []
- User selects 2 labels, clicks a button, and 2 http requests are generated.
- The server receives request for Label 1 and Label 2 at the same time.
- Both requests see the labels as empty, add 1 label to the collection, and
send it.
- Record state as label 1 request sees it: [1], as label 2 sees it: [2]

How will the above conflict be resolved? What can I do so I end up with [1,
2] instead of either [1] or [2] after both requests have been processed?

View raw message