I am carrying out a web application in asp.internet mvc. Now I am at the stage where I actually do a lot of text info for example help texts, eula, online privacy policy etc. I recognized that I am unsure an amount the easiest method to store these texts. 1. Directly within the aspx page 2. In text files after which load the written text via ViewData[] towards the aspx file 3. During my sql database

If use option 3 wouldso would Then i design the database e.g. eula = table x, privacypolicy=table y?

I suppose I simply take some directions of what't the benefits and drawbacks using the options above.

  1. Directly within the ASPX page -> hell no! . You'll have to re-compile and publish for each change. that's terrible.

  2. Text files will allow you to make use of simpler caching just in case this data does not frequently change, but text files are horrible in a wide variety of ways. In the finish you'll have dozens/100s of text files and no clue what references what. (So you'll have to have a database table anyway with pointers towards the files).

  3. Which results in the only real possible solution here, saving my way through the database. You may also use caching as well as, when not a great deal, store my way through a credit card applicatoin variable which is re-indexed every iisreset.

  4. Do not have much knowledge about that, but maybe using LocalResources is a wise decision. This will allow you (as needed) multiple language support further on.

In case your application is actually small, keeping the written text within the pages may be ok, but the moment the application and also the team behind it develops, this may be a problem. Such things as handing of text to some professional author, translations, proofreading with a lawyer is going to be annoying when text is combined with your code

Storing the manuscripts in simple text files ought to be all right for many programs. The only issue here might be when area of the application really alter the text. In these instances storing these questions database may well be a wise decision.

Storing text in database is overkill more often than not. A database mainly offers the advantage of Acidity transactions and indexes on structured data. But when your texts don't change with the application the Acidity qualities aren't of great importance and use. And when these are merely text pieces for use within the application, you'll have the ability to specify the title from the piece/file directly, so indexing as made by the information does not inflict good either. But a database has additionally costs: Large volumes of information will make the cache inefficient for that data which really goes within the database. Transaction handling leads to a performance hit. So without having to, you should not make use of a database.

If these files already exist, and should be expected to alter later, it may be smart to reference them in the database by filename.

If, however, you would like the written text itself to reside in the database, then getting a table of "page content" could fully trust each tuple representing another text: one attribute becoming an identifier for that text, one attribute being the entire text itself.

Whichever you select, I'd recommend to stick to the DRY principle, by picking one canonical easily-handled location and adhering into it.