Cassandra row level locking support while accessing same row by cocurrent users
we are in design phase of our shooping cart application considering Cassandra as Inventory database. now requirment is that if multiple users access same product row in Inventory DB at same time. for example :- Product table : productID productQuantitiy 1000 1 If first user selects product '1000' and add product quantity as '1' in shopping cart, other users accessing the same product should not be able to select this product until it gets free by first user (updated product quantity as 0). so does cassandra provide row level locking support for this kind of scenario
Locking is a complicated problem for distributed systems. It also usually leads to slow operations.
Cassandra 2.0 will introduce a form of lightweight transactions.
Also in 2.0 there will be support for CAS operations. Basically this would allow you to simulate row level locks (update the row iif condition)
While I'm not sure I understand completely the problem you are trying to solve, I think what you are looking for is consistent counters. These have been supported for a while.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With