I have a micro-service which runs on multiple machines in two regions which connects to Cassandra DB. I have the following table structure.
CREATE TABLE gifts (
gift_id text,
user_id text
PRIMARY KEY gift_id
);
The table contains a list of gift id.
During multiple concurrent request each user must be assigned a unique gift i.e select a random gift_id and update the user_id.
Will LWT be helpful to solve this problem?
Limitations:
- Cannot use zookeeper for locking
- Cannot use any relational database.