国际化的表现:RESX与数据库? [英] i18n performance: resx vs. database?
问题描述
问:
我问自己,我是否应该使用.resx文件或数据库本地化我的ASP.NET MVC 3应用程序。
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...
这是个好主意加载DB额外的翻译工作,而这可以通过网络服务器来完成?
抑或是阅读.resx文件比使用一个数据库慢得多?
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 ?
另外,在我看来,该的.resx文件的方式有点不灵活。
你可以假设数据库,并在同一台机器上的Web服务器运行。
您也可以假设Linux系统nginx的Web服务器为通过FastCGI的和调整PostgreSQL服务器单声道。
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.
推荐答案
这并不需要太多的努力,创造条件,拉动资源从数据库中,并生成一个RESX文件的应用程序。从而使你维护的数据库的灵活性和易用性和RESX的性能
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.
我最近买了这种技术为我的MVC网站的工作,这里有几个LNKS我的问题关于这个问题,有些我也回答了自己的解决方案。
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.
- "Run自定义工具"在MVC2项目RESX文件(从外部应用程序/脚本)
- 我是否需要RESX Designer.cs文件?
- Why我收到App_GlobalResources文件组件产生的? (错误= CS0433)
- "Run Custom Tool" for resx files in MVC2 project (from an external application/script)
- Do I need the resx Designer.cs file?
- Why am I getting App_GlobalResources assembly generated? (Error = CS0433)
这篇关于国际化的表现:RESX与数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!