<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">+1 to the design proposed here</span><div><br></div><div>Looks like there is already a session proposed for Grizzly summit: <a href="http://summit.openstack.org/cfp/details/63">http://summit.openstack.org/cfp/details/63</a></div>

<div><br></div><div>best,</div><div>Joe<br>
<br><div class="gmail_quote">On Wed, Oct 3, 2012 at 10:07 AM, Federico Innocenti <span dir="ltr"><<a href="mailto:federico.innocenti@hp.com" target="_blank">federico.innocenti@hp.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<br>
+1 to the design proposed here.<br>
<br>
Even without embracing anything nova specific but simply from a database perspective the soft-delete approach is proven to be a poor solution to most of the problems it promises to solve.<br>
<br>
In addition to what Stan already pointed out, let me recap something that you may already know but so that we have a complete picture, this time solely from a db point of view:<br>
<br>
- restoring a record is more than doing set deleted=0. It is about recovering the all graph of references in the database. Beside the complexity of a restore procedure, it makes not possible to selectively recover just the information we want.<br>



<br>
- tables grow also when alive data (deleted=0) are a small percentage of the total. This takes more space/time for backups and maintenance operations.<br>
<br>
- all queries require for every table involved an additional filter on deleted=0 and thus an additional scan, even though likely most DBMS are able to optimize queries discriminating on a binary flag.<br>
<br>
- using unique constraints and foreign keys is impossible. The nova database schema is now holding more foreign keys than in the old days, but unless normal deletions are performed they are worthless as they cannot protect the database from inconsistencies. And in Nova we saw a certain number of inconsistencies arising in a large usage context.<br>



<br>
<br>
What the soft delete approach tries (badly) to do is in practice to keep an archive of historical data. The best archiving solution could be left to the choice of the single vendor for the time being (until a more comprehensive notification system is in place), since every major DBMS provides its own facilities to implement it. In MySQL as in many other databases you can write db triggers which insert the row being deleted to a shadow table in the same db or in another db.<br>



<br>
Cheers,<br>
Federico Innocenti<div><div><br>
<br>
<br>
______________________________<u></u>_________________<br>
Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~<u></u>openstack</a><br>
Post to     : <a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~<u></u>openstack</a><br>
More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/<u></u>ListHelp</a><br>
</div></div></blockquote></div><br>
</div>