I am working on an application that allows users to dynamically add questions to web forms. We use MySQL as the backend, and I am trying to find the fastest, most efficient way of storing the form data.
Previously, we stored the data in a separate table for each form section. The columns were named according to a system that allowed us to map the dynamic question to its storage location. The drawbacks were that the storage mapping system was badly designed, which made modifying forms with existing data a nightmare. Also, MySQL limitations on the memory per row limited the number of questions we could have per section.
Consequently, I am looking at using a single table to contain all form data. Because essay questions are allowed, I am considering using Text or MediumText as the field type for the actual data. But, I am concerned about RAM usage when running queries. When I run a query for the data, will MySQL be smart enough to allocate only the memory needed for the data in the field (even if it's a small integer) or will it allocate the full amount allowed for the MediumText field?
Furthermore, is there a better way you can think of with regards to storing the data for a dynamic database like this?
Amy