I am working on an application that allows users to dynamically add questions to web forms. We use MySQL as a backend, and I'm trying to find the fastest and most efficient way to store form data.
Previously, we saved data in a separate table for each section of the form. The columns were named according to a system that allowed us to map a dynamic issue to its storage location. The disadvantages were that the storage mapping system was poorly designed, which made modifying forms with existing data a nightmare. In addition, MySQL's memory limitations per row limited the number of questions we could have in each section.
Therefore, I am considering using a single table containing all the form data. Since the essay questions are resolved, I am considering using Text or MediumText as the type of field for the actual data. But I'm worried about using RAM when doing queries. When I run a query for 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 entire allowable value for the MediumText field?
Also, is there a better way that you can store data for a dynamic database as follows?
Amy
source share