Imaging the following 3 relationships in a data model
Entity > Path > Link
Both relationships are 1 to many. So Entity has multiple paths and a path has multiple links.
Should I do this as 3 tables with relationships between the tables
Or create a table that stores that path information as XML.
This table (lets call it Paths), will store 1 path/row. So we end up with 2 tables instead of 3: Entity > Path
The XML looks something like this:
<path>
<link entitySource=1 entityTarget=2>
<link entitySource=2 entityTarget=6>
<link entitySource=6 entityTarget=9>
</path>
What are the benefits of each design? I want to use the 3-table design and need a good explanation to convince the CTO why I should. He is convinced that the XML route is a better design because it will reduce database joins and hence improve read performance.
Read performance is important because this table will be used to store millions of records and needs to be searched quickly.