In the context of a single-purpose website/application (for instance, based on Symfony2), I wish to have a set of forms fillable by users which then will be sent out as a formatted email (with the same labels as the forms on the website.) It is unlikely that they would need to be updated, although new ones may be created in the future.
Would it be wise to just have a set of configuration files based in YAML or JSON (which then would be loaded on-the-fly or cached by the application,) or should they be stored in a database (either as a JSON/YAML blob, or as forms/fieldsets/fields/*sub-fields? (* in the case of dynamically added sets of fields.)
1
My experience in this sort of thing is to prefer to stay consistent within my program. In other words, you feel you can’t do without a database, then your program would likely be more robust if it depended only on that database rather than also on the file system. The more components your program depends on, the more problematic it becomes in terms of maintenance and installation.
However, I suppose it also depends on your application. Configurations that are specific to your installation have no place on a database which may be potentially shared. The information contained within may also present security risks in that case. However, again, it depends on your application. If you intend to have one database per installation and this database is accessed locally (not a public database), this is no longer important, however should you find yourself in that position, you should probably use both a local file-based configuration (JSON, YAML, XML, whatever your preference is) for the information specific to that particular installation, as well as a database for everything else.
Otherwise, I would stick with the database. Then, if your application does not require a database, there is no need to add a dependency to a database simply to place your configuration. It would make sense to strictly use only a local configuration on the file system at that point.
Hope that helps!