• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Database design for lists

Noobsa44

Member
I’m attempting to develop a database which can store arbitrary lists of data and am looking for suggestions on design. What I want is to be able to have a list I can associate to other tables (such as a user) to a set of data points. I have simplified my current idea, but here is my current design:

DataListTable:
DataListId

DataElementTable:
DataListId, DataId, DataTypeId, DataValue, Description

Is there a better design or a more efficient way to design this? Thanks!
 
What you are doing is called the "Entity-Value-Attribute" model, google that term for a wealth of information both for and against, advanages you can use, pitfalls to look for.

I've used it just fine on a number of occasions, but the main drawback is querying/reporting. If you are going to be accessing the data by ListID, you should be just fine.

Depending on your use cases, it may be benificial to have one or more dedicated columns for numbers. So instead of just a value column, have a txtValue, intValue, floatValue, etc. And you would know which column stores the data based on your dataTypeID, but this is small optimization that wouldn't net much gain in most scenarios
 
Last edited:
How arbitrary are these list? Are you sure you can't break the down in like 5 or 10 types of lists?

Another option would be something else than a RDBMS meaning either a document-oriented DB (CouchDb) or a GraphDatabase. Both of them allow storage of such arbitrary data much easier.
 
Back
Top