I am designing a CMS in C# and need to decide where to save configuration settings for the site. Also considering defining my base html templates and then processing them server side to create the pages ahead of time.
So what is generally faster/less overhead for the server reading an XML file or querying that same information from a local database?
It seems unlikely to me that this will be a bottleneck in your code. How often are you planning on reading configuration settings? Configuration is typically fairly small, and read infrequently. There are more important things to consider about where and how to store it:
Bootstrapping: you can probably rely on your app having access to the local file system, and you can hard-code a configuration filename… but if all your configuration is in the database, where do you configure which database to talk to?
Ease of tweaking and deployment: editing a configuration file on the server by hand may be faster than making a change in the database… but if you have multiple servers, do you want to tweak a file on every one of them?
Simplicity of code reading/processing the configuration: what would your configuration look like? Is it naturally hierarchical? If so, XML is likely to be a good fit. If it’s more like a set of name/value pairs, then a simple table is a good fit. Of course, you can store XML within a database – you don’t have to tie the storage location and the storage format decisions together. Editing an XML document on the database may well be harder than either editing an XML file or changing individual values… but you can always make life easier with tools for this sort of thing.