What's considered "best practice" for storing small and medium amounts of general data for use within Umbraco applications such as user controls and the like.
This would be data that is not intended to be viewed by site visitors, per se, but used, for example, as configuration data or used in calculations.
Isn't is best to avoid creating content nodes for this purpose, as they would become part of the overall site cache?
Thanks. Your views will help shape my approach to developing custom apps in Umbraco from now on.
There isn't really a "best practice" for storing application/config data, but there are many ways to do in Umbraco - all depending on how you want to manage it:
As you suggested, store them in a document-type - for example, Doc2Form can store the form data in a content node. Yes gets put in the XML cache, but it makes it readily available in XSLT.
Config / XML file. For config/settings, Web.config is the usual ASP.NET developers choice. For small amounts of data, keep in an XML (under the /data folder - which a .config extension, to keep it safe).
Separate database table. Requires more work, but you have more control on how the data is stored/handled. Dirk wrote a blog post on Building Custom Sections.
... in a nutshell, it's up to you - and the level of development you want to do. Storing data in Umbraco (as content), the UI is already there!
I've worked on sites where I've stored meta data in the content tree and I've worked on sites where I've stored it in a custom config section of the web.config.
Each option has different pros and cons, the ultimate decision is really how frequently you'll be needing to update the meta data.
Storing application data
Hello Umbraco colleagues,
What's considered "best practice" for storing small and medium amounts of general data for use within Umbraco applications such as user controls and the like.
This would be data that is not intended to be viewed by site visitors, per se, but used, for example, as configuration data or used in calculations.
Isn't is best to avoid creating content nodes for this purpose, as they would become part of the overall site cache?
Thanks. Your views will help shape my approach to developing custom apps in Umbraco from now on.
David F Hill
Hi David,
There isn't really a "best practice" for storing application/config data, but there are many ways to do in Umbraco - all depending on how you want to manage it:
Thanks for your response, Lee.
That sums it up nicely. I really like the way Umbraco gives us enough choices to make the right call for the situation at hand.
Cheers, David
I've worked on sites where I've stored meta data in the content tree and I've worked on sites where I've stored it in a custom config section of the web.config.
Each option has different pros and cons, the ultimate decision is really how frequently you'll be needing to update the meta data.
is working on a reply...