<div dir="ltr">Hi guys,<div><br></div><div>I am referring to the blueprint: <a href="https://blueprints.launchpad.net/magnetodb/+spec/row-expiration" target="_blank">https://blueprints.launchpad.net/magnetodb/+spec/row-expiration</a> . We want to provide our end users with ttl feature on a row in MagnetoDB.</div><div><br></div><div>As it stands today in cassandra, ttl is on a column basis rather than a row basis. i.e. when you insert a row with an insert statement the ttl is applied on all the columns. But when you update a row and use ttl there ttl for only the columns present in SET clause of UPDATE statement.</div><div><br></div><div>for e.g if you have a USER table with schema (name text primary key, age int) and you insert a row with statement INSERT INTO USER(name, age) values ('a', 1) and later update this with UPDATE USER USING TTL 10 set age=2 where name='a', then the age column will get updated and only the age column will disappear after 10 seconds.</div><div><br></div><div><ul><li>So in MagnetoDB if a user inserts data without ttl and later updates the same row with ttl and some updated column values then ttl is only applied on the updated columns. We should do an insert in this case to make the whole row disappear. Simlarly if the user inserts the data with a ttl but updates the data without ttl then we should fetch the ttl for the row and then update the row with remaining ttl for the row.<br></li><li>The same problem remains with the conditional update But it's more difficult to tackle without any locking mechanism.</li></ul><div>The simplest solution is to allow ttl only in insert statement and let the users know about this.</div></div><div><br></div><div><div><div><div dir="ltr"><div>Cheers,<br></div>Ajaya<br></div></div></div>
</div></div>