页面/电子邮件内容架构
我正在创建一个类似于 yelp 的用户内容网站。网站将支持 15 种不同语言的多语言。需要一些关于存储系统内容的建议,即:
- 页面内容(所有默认页面 文本和菜单项)
- 页面属性 (标题栏、关键字等元标记、 描述等)
- 电子邮件内容 (主题、页眉、页脚 - 均为 html 和文本版本)
出于性能目的,我觉得只有 1 个表用于所有这些列,例如:ID、Eng、Fr、Es、Gr...,其中每列是一种语言,ID 是使用的关键字来识别这个词。根据用户的语言会话,它将提取匹配的单词进行加载。
问题:
- 此设计是否会随着系统的扩展而扩展 内容增加到数千个 页数?
- 编辑文字方便吗?
- 性能影响?
- 有更好的吗 以此为基础进行设计 需要?
- 任何其他类型的系统 我需要维护的内容吗?
- 也适用于页面标题栏等文本 这是动态的 - 就像 个人资料页面将是“用户的完整 name - 站点名称)所有这些都可以 在数据库或代码级别完成?
- 最关心的是查找值,例如城市名称、类别名称等。它们驻留在自己的查找表中。因此,要翻译它们,我是否将语言列添加到这些表中,或者仅将这些查找值复制到内容表中?
平台:PHP/MySQL
I am creating a user content website similar to yelp. Site will support multi language in 15 different languages. Need some advice on storing system content, that is:
- Page content (all the default page
text and menu items) - Page attributes
(Title bar, meta tags like keywords,
description, etc) - Email content
(Subject, header, footer - both html
and text versions)
For performance purpose, I feel only 1 table is to be used for all of this with colunms like: ID, Eng, Fr, Es, Gr,... where each column is a language and ID is the keyword used to identify the word. Based on user's language session it will pull in the matching words to load.
QUESTIONS:
- Will this design scale as system
content increases to thousands of
pages? - Easy to edit text?
- Performance impact?
- Any better
designs out there based on this
needs? - Any other type of system
content do i need to maintain? - Also for text like page title bar
which are dynamic - like on the
profile page it will be "User's full
name - Site name) all those can be
done at DB or code level? - Biggest concern - the lookup values such as city names, category names, etc. they reside in their own lookup table. So to translate them do i add language columns to those tables or cpy these lookup values to the content table only?
Platform: PHP / MySQL
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问:当系统内容增加到数千页时,这种设计是否可以很好地扩展?编辑文字方便吗?性能影响?针对这种需求,还有更好的设计吗?我需要维护任何其他类型的系统内容吗?
答:所有应用程序对大负载的响应都不同,因此没有任何直接的答案。只要您减少数据冗余并保持干燥(不要重复自己)。查询和代码时的性能更好。
问:对于像页面标题栏这样的动态文本 - 就像在个人资料页面上一样,它将是“用户的全名 - 网站名称),所有这些都可以在数据库或代码中完成 答
:你可以把它放在数据库中,但你可以设置缓存系统,这样你的页面就不会查询数据,直到数据库中没有变化,这样它看起来像静态页面,但同时又是动态的。
最后,我建议您使用一些标准框架,如 zend、codeigniter、cakePHP,因为他们在
,因此使用框架,总是安全的,但这并不意味着从头开始的项目就不安全。
Q:Will this design scale well as system content increases to thousands of pages? Easy to edit text? Performance impact? Any better designs out there based on this needs? Any other type of system content do i need to maintain?
A:All applications respond differently to large load so there isn't any straight answer.As long as you are reducing data redundancy and keeping it DRY(dont repeat yourself). Performance while query and code is better.
Q: Also for text like page title bar which are dynamic - like on the profile page it will be "User's full name - Site name) all those can be done at DB or code level?
A: You can have it in DB but you can make cache system. So you page dont query data until there is not change in db. In this way it look like static page but dynamic at same time.
At end , i would sugesset you to use some standard framework like zend, codeigniter, cakePHP. AS they have better solution of large scale projects on
So using framework ,is alway safe but it dont mean having project from scratch are not.