Search code examples
databaseperformanceasp.net-mvc-3internationalizationresx

i18n performance: resx vs. database?


Question:

I'm asking myself whether I should use .resx files or a database to localize my ASP.NET MVC 3 application.

I use a database anyway, so there's no additional effort required for a data-access layer.

I know I can do both, but I'm a bit worried about performance...

Is it a good idea loading the DB with additional translation work, whereas this could be done by the webserver ?
Or is reading the .resx files much slower than using a database ?

Also, it seems to me that the .resx-file way is a bit inflexible.
You can assume that the db and the web-server run on the same machine.
You can also assume a Linux system with nginx as webserver, mono via fastcgi and a tuned PostGreSQL server.


Solution

  • It doesn't take much effort to create an application which will pull the resources out of the database and generate a resx file. Thus giving you the flexibility and ease of maintenance of the database and the performance of resx.

    I recently got this technique working for My MVC website, here are a few lnks to my questions on the subject, some of which I also answered myself with the solution.