So, now i am sitting just thinking over the Rule Insertion Scenario .!
Theres not really much to think of except for the DB Design which has changed once again.
Heres my latest design :
RuleMetaData:
| Rule_Meta_data_ID | Rule Description | FLAG_ID |
| 1 | Any description about the rule | 2 |
Rule_Set
| Rule_set_id | Rule_Meta_data_ID | Field_id | Logic_id | Value |
| 1 | 1 | 1 | 1 | mysql.sheeri.com |
| 2 | 1 | 2 | 1 | 3306 |
| | | | | |
Field:
| Field_id | Description |
| 1 | Port |
| 2 | Hostname |
| Logic_id | Description |
| 1 | AND |
| 2 | OR |
Flag:
| Fag_id | Description |
| 1 | Use |
| 2 | Read |

1 comment:
I like the idea of a lookup table, but I'd suggest instead of using numeric flags, use the text, and then have the lookup tables just be one column. then make a foreign key from the table to the lookup table.
Pro: No need to join tables to find the display value.
Con: text is a little bigger than numbers
I think due to the small # of rows that will be in the database tables (probably a few hundred at most), there's no reason not to do it this way. . .thoughts?
Post a Comment