I am using ScyllaDB and have a table called product with a column stock. When the stock changes, I perform a query to select the current stock, then calculate and update the new value in the database. However, when there are multiple concurrent requests, the calculations become incorrect.
Does ScyllaDB have a mechanism to handle this issue? I have tried using Lightweight Transactions (LWT), but it doesn’t seem to be effective. The results of the select queries are always the same.
How can I ensure the accuracy of stock calculations with concurrent updates in ScyllaDB?
Thank you!