Re: store individual inventory items in a table, how to assign them correctly

2016-11-08 Thread Vladimir Yudovin
Hi, can you elaborate a little your data model? Would you like to create 100 rows for each product and then remove one row and add this row to customer? Best regards, Vladimir Yudovin, Winguzone - Hosted Cloud Cassandra Launch your cluster in minutes. On Mon, 07 Nov 2016

Re: store individual inventory items in a table, how to assign them correctly

2016-11-08 Thread Carlos Alonso
Bear in mind that LWT will, under certain circumstances fail too. See amazing Chris Batey's talk about it on Cassandra Summit: https://www.youtube.com/watch?v=wcxQM3ZN20c Carlos Alonso | Software Engineer | @calonso On 7 November 2016 at 22:22, Justin Cameron

Re: store individual inventory items in a table, how to assign them correctly

2016-11-07 Thread Justin Cameron
You can use lightweight transactions to achieve this. Example: UPDATE item SET customer = 'Joe' WHERE item_id = 2 IF customer = null; Keep in mind that lightweight transactions have performance tradeoffs ( http://www.datastax.com/dev/blog/lightweight-transactions-in-cassandra-2-0) On Mon, 7

store individual inventory items in a table, how to assign them correctly

2016-11-07 Thread S Ahmed
Say I have 100 products in inventory, instead of having a counter I want to create 100 rows per inventory item. When someone purchases a product, how can I correctly assign that customer a product from inventory without having any race conditions etc? Thanks.