title: Cassandra Light weight transaction performance penalty
body: <p>I have two cassandra table, a record table and a counter table. 
  The counter table keeps a counter for each kind of record in the record table. </p>
  
  <p>When I insert a new record into the record table, I will update the counter table at the same time. But it's possible that the new record is already in the record table. It's Ok to insert the same record twice, but then I would add the counter twice, which is not correct. </p>
  
  <p>I have two solutions now. </p>
  
  <ol>
  <li><p>Fetch a record from cassandra with the new record key. If it's not null, I will not insert the record and increase the counter. </p></li>
  <li><p>Use light weight transaction to let cassandra check if the record already exists. </p></li>
  </ol>
  
  <p>Solution 2 will make the insert "atomic", but the doc says it will have performance penalties. In Solution 1, I'm sending 2 queries, this will also have performance penalties. </p>
  
  <p>Currently I'm using solution 1. I'm new to cassandra light weight transaction, so I don't know the cost of atomicity. Does anyone know which solution is better? </p>