136 | | - only one type of keys (int) - faster, simpler, |
137 | | the unique ''resource_prop'' table approach is possible |
138 | | - more compact, not that difficult to read either (there would always be a |
139 | | ''prop=id'', ''value=the natural key'' entry |
140 | | - renaming is easy (relations preserved) |
141 | | |
142 | | This suggests that using surrogate keys would be preferable. |
143 | | |
144 | | |
145 | | Now if this is the case, the '''resource_prop''' table could as well become: |
146 | | ||= id ||= prop ||= value ||= //seq// |
147 | | and the ''realm'' information could simply be stored as another prop/value entry. |
| 138 | - only one type of keys (int) - faster, simpler, |
| 139 | - the unique ''resource_prop'' table approach is possible |
| 140 | - more compact, not that difficult to read either as there would always be a prop/value pair (`'id'`,`<the natural key>`) |
| 141 | - renaming is easy (relations are preserved) |
| 142 | |
| 143 | |
| 144 | This all suggests that using surrogate keys would be preferable, with a single '''resource_prop''' table. |
| 145 | |
| 146 | If this is the case, the '''resource_prop''' table could as well become simply: |
| 147 | ||= id ||= prop ||= value ||= //seq// || |
| 148 | |
| 149 | - the ''realm'' information could simply be stored as another prop/value entry (`'realm'`,`<the resource realm>`) |
| 150 | - this could be extended naturally to the ''support of multiple projects'', with another (`'project'`,`<projectid>`) prop/value pair; this is better as adding an additional `project` column to all entries |
| 151 | |
| 152 | Note that having a separate table for storing the ''relations only'' wouldn't necessary be better, as we would likely have to store something like: |
| 153 | ||= role ||= source ||= target ||= seq || |
| 154 | |
| 155 | which is just a reformulation of: |
| 156 | ||= prop ||= id ||= value ||= seq || |
| 157 | |
| 158 | i.e. the proposed '''resource_prop'''. |