Nick
Nick

Reputation: 21

How to store user defined data structures?

I'm building a mobile application that records information about items and then outputs an automatically generated report.

Each Item may be of various types, each type requires different information to be recorded. The user needs to be able to specify what is to be stored for each type.

Is there a "best" way to store this type of information in a relational database?

My current plan is to have a Type table that maps Types to Attributes that need to be recorded for that Type. Does this sound sensible? I imagine that it may get messy when I come to produce reports from this data.

I guess I need a way of generalising the information that needs to be recorded?

I think I just need some pointers in the right direction.

Thanks!

Upvotes: 0

Views: 138

Answers (1)

oetoni
oetoni

Reputation: 3907

Only a suggestion, might not be an answer... use JSON and go for no-sql database. Today it is more convenient to operate and play around with data in not strictly relational database format.

That way you can define a model(s), or create you own data structure as mentioned and store it easily as a collection of documents of that model. Also no-sql allows structure changes without obligating you to define entire "column" for all "rows" present there ;)

Upvotes: 0

Related Questions