title: Getting database entry when performing delete operation in Cassandra
body: <p>I have a web service that is maintaining the state of a "request". The possible states are "Active" and "InActive". I am storing the request information in a Cassandra DB. I have two tables - one for Active requests and another for InActive Requests. They both have the same schema. </p>
  
  <p>My schema is as follows:</p>
  
  <pre><code>ActiveRequests{
    UserId text,
    RequestId int,
    RequestData text
    PRIMARY KEY(UserId, RequestId)
  }
  </code></pre>
  
  <p>I need to implement an API that will move a request from the Active state to the InActive state. I plan on doing this by deleting the entry from the Active table and then adding the removed entry to the InActive table. </p>
  
  <p>In Cassandra it seems like a <code>DELETE</code> operation doesn't actually return the data that was deleted. So, I have to do a <code>SELECT</code> on the request entry(so that I can get all the request data for adding to the InActive table) and then do a <code>DELETE</code> operation. Is there a better way to do this?  </p>
  
  <p><strong>EDIT</strong></p>
  
  <p>You may ask why I am maintaining Active and InActive requests as separate tables. I could potentially combine them into a single table and have an <code>IsActive</code> column. My reasoning for maintaining  separate tables is as follows:</p>
  
  <p>I want my queries to the Active Table to be very quick. If I want to query all the Active requests in a table that has both Active and InActive requests that won't be as optimal. The partitionKey is userId and I expect the InActive table to have several 1000 requestIds for a given UserId. But, Active should only have 10 or more requestIds per UserId.</p>