Hi, I would like to very nicely ask about your best practice with dynamically generated forms and form fields. The ideal state is generate all forms in my app dynamically. Current state is:
- dynamically generated forms im storeing into forms collection,
- dynamically generated form fields im storing tinto formFields collection,
- data from all the forms I’m storing into same collection “formData” and can be probably a performance issue.
Question:
Isn’t it better idea to split form data to separate collections? If yes, I will need dynamically generate new or remove existing form collections. Is it possible with Meteor? Is it good idea?
Does exists any known design pattern for it?
Thans a lot!
Assessing different data models would require a lot more information about the data and how it is used. However, one comment. You have alluded to a worry that your formData collection might hold too much data and for performance it might be better to have a separate collection for each form. I would suggest not approaching this topic at this angle at all. In most databases it does not really matter very much how many documents/rows you have in a collection/table. What matters is that the database is able to index these documents well. At least for most reasonably sized data sets.
Can you recommend some robust datamodel design pattern? Now I’m using simple mode, when (as I written) storing forms which its configuration into “forms” collection, form fields I storing into “formFIelds” collection and data into “formData” collection. And It works without any problems. But I’m searching some patterns/best practices/recommendations to be sure, that my datamodel is professional acceptable and not some “donkey” datamodel. If you can recommend me some datamodels or relevant materials to deeper understand, I will be appreciate it.
From where do you have this information or experiences? Can you send me please some resourse about it, because my experience is opposite and especially in mongo and postgres (also with indexes, not everything is possible to effective index in mongo).
@vooteles Thanks a lot.