[Openstack] how to using constraint in nova db?

张俊峰 zjfhappy at 126.com
Sat Aug 4 05:46:30 UTC 2012


soft deletes is used in nova db. but how to use uc with soft-deletes?
exp: the address field of modes.VIrtualInterface is unique.
"""
 Using constraints (UC, FK) is impossible. Using a unique constraint (UC) is not really possible, as the RDBMS will take into account the rows which are 'deleted' as well. So a value might be unique for the rows in the working set, but for the total set of rows in the table it doesn't have to be unique and the update or insert fails. In our example above with Customer and Order, we've seen that foreign key constraints are not really working anymore either, as they don't protect us from 'deleting' a PK side while keeping the FK side: for the RDBMS, both rows are still there and everything is fine (which is not the case)
http://weblogs.asp.net/fbouma/archive/2009/02/19/soft-deletes-are-bad-m-kay.aspx
"""
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20120804/d2647101/attachment.html>


More information about the Openstack mailing list