So i need to build at database where the admin user can add and remove models without me. Instead of the normal type with all the values in one big table and them all with varchar type, I was thinking of putting each field in a model in a separate table with EntityID and Value and whatever that field requires.
So a Model example of a person could be:
FieldName | Type |
---|---|
Name | varchar |
Birthday | date |
Address | int (Linked to a model) |
The database could then contain 3 tables:
- One With EntityId and varchar to store the names.
- One with EntityID and Date to store the date
- One with EntityId and EntityID to point to the address model
The selects would do a lot of joins but we could index the Fields that need searcing, EntityId would be a int and always be indexed.
The asp.net server is gonna keep control on the models and build querys that only selects what they needs.
Do you see any major problems with this, i know we don't like EAV and we are locked to sql server for now.
I am not a DBA man...