I have some survey data which is currently stored in tables that are 100+ columns wide (one column per question). To simplify it, I've been thinking about making some models like:
- Survey
- Question
- Response
However, I'm not sure how to approach it through Rails because:
- I need nice views (better than autogenerating forms) for many surveys.
- I need validation (some are simple, but others are complex).
- I need to report pivoted data (e.g. one column per question). Besides loading everything up as an
Array
and then callingtranspose
, I'm not sure what to do here.
(Basically, there are still reasons why I'd want to treat each survey like a normal ActiveRecord model.)
Is this database design change worth making or am I overcomplicating things? Would a document database (such as mongodb
) make this easier?