I'm wondering how Umbraco stores all it's content.
You see there's an umbraco.config file in App_Data but is that a cache of is that the only data?
Can every node you create be found in the database?
And if you do stuff in you razor view, f.ex. loop through all the children of Model.Content. Where is that data from? Did it come from the database or the xml file?
The content data is stored as an XML document in-memory, which - as you noted - is dumped out to a file at /App_Data/umbraco.config (this is only used to quickly reload the XML document back into memory at app-start).
All the raw data is stored in the database - primarily in the umbracoNode table, with references to various other tables (e.g. cmsPropertyData, etc). There's a database diagram floating around on this site somewhere (I don't have a link at the moment).
So when you do stuff in a Razor view, you'll be accessing the in-memory XML when calling Model.Content, etc.
Thanks for the quick responds. So the backend probably also use the xml to render the tree in the content section, etc.
And so it's also not a big deal if you remove your /App_Data/umbraco.config file? (Not that I have.)
This does explain why everything can be query with X-Path.
Yep, if you ever delete the umbraco.config, then the website + back-office will still work fine. Then on the next web-app start-up, the file will be recreated. (The raw XML is stored in a database table called cmsContentXml)
There is talk of in future the XML cache will be replaced with something else - maybe Lucene, (or something else clever) ... but for now it's XML (and if you know XPath, it will be your best friend!)
How does Umbraco store its data
I'm wondering how Umbraco stores all it's content. You see there's an umbraco.config file in App_Data but is that a cache of is that the only data?
Can every node you create be found in the database?
And if you do stuff in you razor view, f.ex. loop through all the children of Model.Content. Where is that data from? Did it come from the database or the xml file?
Hi nojaf,
The content data is stored as an XML document in-memory, which - as you noted - is dumped out to a file at
/App_Data/umbraco.config
(this is only used to quickly reload the XML document back into memory at app-start).All the raw data is stored in the database - primarily in the
umbracoNode
table, with references to various other tables (e.g.cmsPropertyData
, etc). There's a database diagram floating around on this site somewhere (I don't have a link at the moment).So when you do stuff in a Razor view, you'll be accessing the in-memory XML when calling
Model.Content
, etc.Hope this answers some of your questions.
Cheers,
- Lee
Hello Lee,
Thanks for the quick responds. So the backend probably also use the xml to render the tree in the content section, etc. And so it's also not a big deal if you remove your
/App_Data/umbraco.config
file? (Not that I have.)This does explain why everything can be query with X-Path.
Thanks again,
Nojaf
Hi Nojaf,
Yep, if you ever delete the
umbraco.config
, then the website + back-office will still work fine. Then on the next web-app start-up, the file will be recreated. (The raw XML is stored in a database table calledcmsContentXml
)There is talk of in future the XML cache will be replaced with something else - maybe Lucene, (or something else clever) ... but for now it's XML (and if you know XPath, it will be your best friend!)
Cheers
- Lee
is working on a reply...