<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div apple-content-edited="true"><br class="Apple-interchange-newline">
</div>
<br><div><div>On Apr 26, 2012, at 12:03 PM, Monty Taylor wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br><br>On 04/26/2012 10:14 AM, Sean Dague wrote:<br><blockquote type="cite">On 04/25/2012 05:17 PM, Vishvananda Ishaya wrote:<br></blockquote><blockquote type="cite"><blockquote type="cite">The main issue is when the relevant tables are moved into a separate<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">service a la quantum or cinder. We can't keep referential integrity<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">across multiple databases, so the foreign keys in this case need to be<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">removed. It leads to an odd situation when there is still an internal<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">implementation in addition to the external implementation because the<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">internal implementation no longer has foreign keys.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">As an example, we used to have foreign key relationships between<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">instances and networks. We can no longer have these because we support<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">networks declared externally. The internal network management now has no<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">referential integrity, but this is the price we pay for separation of<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">concerns. We are going through a similar set of relationship-breaking<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">with the volume code.<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">There are definitely the practical aspects of where this "can't" be done<br></blockquote><blockquote type="cite">because the services have split out, and I think that's fine.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">But enforcing the ref constraints where possible just provides another<br></blockquote><blockquote type="cite">level of safety in the data. A policy where we break FK relationships if<br></blockquote><blockquote type="cite">the preferred core model is 2 services (i.e. Nova / Quantum), but we add<br></blockquote><blockquote type="cite">FK constraints within a service might be a good idea.<br></blockquote><br>I think the real key is to have a config option to tell sqlalchemy to<br>not, even if we're running innodb, add the foreign keys to the DDL sent<br>to the database. If sqlalchemy doesn't have that ability, we should<br>write it and contribute it, because anyone using MySQL at scale via<br>sqlalchemy actually wants the feature, whether they recognize it yet or not.<br><br></div></blockquote><div><br></div><div>I registered a blueprint for this: <a href="https://blueprints.launchpad.net/nova/+spec/disable-fkeys-by-config">https://blueprints.launchpad.net/nova/+spec/disable-fkeys-by-config</a></div><div><br></div></div><br><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Take care,</div><div><br></div><div>Lorin</div><div>--</div><div>Lorin Hochstein</div><div>Lead Architect - Cloud Services</div><div>Nimbis Services, Inc.</div><div><a href="https://www.nimbisservices.com/">www.nimbisservices.com</a></div><div><br></div></div><br class="Apple-interchange-newline"></div></div></body></html>