There are a ton of questions like this, but they are mostly very generalized, so I'd like to get some views on my specific usage.
I'm building a new project on my own in Django. It's focus will be on small businesses. I'd like to make it somewhat customizble for my clients so they can add to their customer/invoice/employee/whatever items. My models would reflect boilerplate items that all ModelX might have. For example:
- first name
- last name
Then my user's would be able to add fields for whatever data they might like. I'm still in design phase and am building this myself, so I've got some options.
Right now the 'extra items' models have a FK to the generic model (
CustomerDataPoints for example). All values in the extra data points are stored as char and will be coerced/parced into their actual format at view building. In this build the user could theoretically add whatever values they want, group them in sets and generally access them at will from the views relavent to that model.
Pros: Low storage overhead, very extensible, searchable
Cons: More sql joins
My other option is to use some type of markup, or key-value pairing stored directly onto the boilerplate models. This coul essentially just be any low-overhead method weather XML or literal strings. The view and form generated from the stored data would be taking control of validation and reoganizing on updates. Then it would just dump the data back in as a char/blob/whatever.
<datapoint type='char' value='something' required='true' />
<datapoint type='date' value='01/01/2001' required='false' />
Pros: No joins needed, Updates for validation and views are decoupled from data
Cons: Much higher storage overhead, limited capacity to search on extra content
So my question is:
If you didn't live in the contraints impose by your company what method would you use? Why? What benefits or pitfalls do you see down the road for me as a small business trying to help other small businesses?
Just to clarify, I am not asking about custom UI elements, those I can handle with forms and template snippets. I'm asking primarily about data storage and retreival of non standardized data relative to a boilerplate model.