c# - Which one is faster reading an XML file or querying a database -
I am preparing CMS in C # and need to decide where to save the configuration settings for the site . Also consider defining my base HTML templates and then processing the server side to make the page ahead of time.
So what is the faster / less overhead from the server or the local database to read an XML file?
It seems that this will be a hindrance in your code. How often are you planning on reading the configuration settings? The configuration is generally enough , and sometimes reads more important things to think about where it and how to store it:
-
Bootstrapping: You can probably access your app's local file system, and you hard-code a configuration file name ... but if all your configuration is in the database, then what database do you configure to talk to Are you
-
Tweaking and ease of deployment: A configuration editing server may be , faster than making changes in the database. ..but if you have multiple servers, do you want to zoom a file on each one of them?
-
Simplicity of Reading / Processing Code: What does your configuration look like? Is it naturally hierarchical? If so, then XML is likely to be a good fit. If this name / value is more like a set of pairs, then a simple table is a good fit. Of course, you can store XML inside a database - you can store location and storage format No not to add decisions together. Editing an XML document on a database It is difficult to either edit an XML file or change individual values ... but you can always make life easier for these kinds of things.
Comments
Post a Comment