We are developing a .NET application with a SQL Server back-end. The client requests the ability to dynamically add custom attributes to entities after the application has been deployed.
As suggested in a similar question we could create a table which would then contain a row for each custom attribute value (Entity-attribute-value model). However, we are considering allowing end users to actually modify the table (also suggested in the same question) i.e. adding and removing columns.
(Edit: as noted in the comments, DDL wouldn't be executed directly by users or the application, but through stored procedures ensuring that everything runs smoothly)
Main reasons are:
- Improved performance/searchable attributes
- The attributes are almost always required to appear as columns e.g. in a data grid in the user interface or when extracting data for further processing in Excel/PowerPivot.
- Data is strongly typed (as opposed to storing all attribute values as varchar)
- A simplified data model
Are there any caveats that we should be aware of?
Things that come to mind are:
- Backup/restore operations that might be unable to handle the changing data structure
- Dependent objects (such as views) that aren't properly updated to reflect these changes (a dependent view would have to perform a
select * from table
in order to include any added columns). - ...
Any input regarding this approach is greatly appreciated.