douzhoulei8959 2012-02-19 18:33
浏览 26

将html模板组件存储在数据库中

I am looking for a solution to a staright forward problem:

There are some templates which are divided into parts of two types: 1. image 2. text

I call these parts as components of the template whose values are entered by the user. The image component can have a link, alt text related to it. The text component can have plain text or some lines of html. The value of these components are used to render the final output of the template.

There can be around 5-10 components for each template which may not be common for other templates, like:

pageTitle
tagline
firstParagraph
buttonText
headerImage     -   Image Component
firstImage      -   Image Component

So the simple calculation says:

  • 1 page = 1 template
  • 1 user can have > 1 pages
  • Each template can have 5-10 components

So if i store it like:

COMPONENT   TYPE        VALUE         LINK

pageTitle   text        Hello world
tagline     text        tagline here
headerImage image       image.jpg     http://example.com

And it can be any number of users, so lets say 10000 pages will have > 10000*10 components in a db!!

How can we have less number of entries and with the best performance? Better schema? Serialized? Json? File based system? or anything else... What can be done?

Thanks in advance!

  • 写回答

2条回答 默认 最新

  • douzi9211 2012-02-19 19:30
    关注

    100k records are not a large number, most database can handle this number

    if there will be so many users(pages), any solution you mentioned will cost much resources

    评论

报告相同问题?

悬赏问题

  • ¥15 chaquopy python 安卓
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题