网站构建器的数据库 [英] Database for a web site builder

查看:102
本文介绍了网站构建器的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想象一下,一家公司允许人们使用他们的网络软件来构建网站。每个客户都有一个或多个他们已经构建的网站,每个这些网站将包含可能一百个单元格,用于保存网站的各个部分的HTML。我们知道确定每个单元格只会在一个网站使用。所以我们有:

Imagine a company that lets people use their web software to build web sites. Each customer has one or more sites that they've built and each of these sites will contain perhaps a hundred "cells" that hold the HTML for various pieces of the site. We know for certain that each cell will only be used in one site. So we have:

现在我们需要描述每个网站中的单元格。

Now we need to describe the cells in each site.

一种方法是拥有一个巨大的我的意思是巨大的)单元格表,其中包含由一百万客户创建的所有单元格。然后每个单元记录将指向使用它的siteId。

One way would be to have a huge (and I mean huge) cell table that contains all the cells created by a million customers. Then each cell record would point back to the siteId where it was used.

但是,似乎应该有一种方法来利用每个单元格在其网站中只有百分之一的知识,因此不是搜索表的100万个单元格,我们可以搜索一个100个单元格的表,或者只是要求那个表,当我们想要构建该网站。

But it seems that there should be a way to take advantage of the knowledge that each cell is only one of a hundred or so in its site, so instead of searching a table of 100 million cells we could search a table of 100 cells, or just ask for that table when we want to build that site.

感谢您的输入。

推荐答案


<一种方式是拥有一个巨大的(我的意思是巨大的)单元格表,
包含由一百万客户创建的所有单元格。然后在单元格记录的每个
行中,我们将指向使用它的siteId。

One way would be to have a huge (and I mean huge) cell table that contains all the cells created by a million customers. Then in each row of a cell record we'd point back to the siteId where it was used.

大概是我会去的路线。当您使用适当的性能调优技术时,大多数现代数据库可以处理数亿行的表。

This is probably the route I would go. Most modern databases can handle tables with hundreds of millions of rows when you use the proper performance tuning techniques.

我不是正面的,但是它听起来像你正在考虑将每个网站的单元格放置在一个网站特定表中,努力保持每个表中的行数下降。如果这是真的,你似乎在尝试过度优化之前,你有任何性能问题。

I'm not positive but it sounds like you are considering placing cells for each site in a site specific table in an effort to keep the number of rows in each table down. If this is true it seems like you are trying to over optimize before you have any performance problems.

我将专注于创建一个设计良好的规范化数据库在这一点,如果你遇到性能问题,我会回到这里与具体的性能问题。

I would focus on creating a well designed normalized database at this point and if you run into performance problems, I would come back here with the specific performance problem.

这篇关于网站构建器的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆