Welcome Guest, Not a member yet? Register   Sign In
Language files vs. Databases
#1

[eluser]KeyStroke[/eluser]
Hi,

I'm using language files to translate a lot of generic strings throughout my site. So a single page could have 10 to 30 requests for strings from a language file.

Someone told me my application would perform much faster if I used a database instead. But I think that I should use a Database only for big chunks of text, not small strings and error messages.

So, performance wise, which is better for a multi-lingual site: Language files or Databases? and why?
#2

[eluser]xwero[/eluser]
The language file is loaded to an array variable in the language class. I don't think it matters that much. To be sure you could do a benchmark with the same amount of line in a file and in a database table.

I keep the quasi static strings in language files and more frequently changed strings in a database.
#3

[eluser]KeyStroke[/eluser]
Yea that's almost exactly what I'm doing.

Benchmarking is a good idea, but maybe someone who went through all of this already can help.
#4

[eluser]stanleyxu[/eluser]
Using database for storing localization text is not a good idea. IMO, accessing database is much expensive than reading text from a text file.




Theme © iAndrew 2016 - Forum software by © MyBB