在高流量网站规范化或非规范化 [英] Normalize or Denormalize in high traffic websites

查看:161
本文介绍了在高流量网站规范化或非规范化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如果将数据库用于记录保存或归一化技术或标准化技术,则应使用数据库设计和归一化数据库的最佳做法两者的组合?



将规范化数据库设计为用于记录保存以减少冗余的主数据库是明智的,同时保持数据库的另一个非规范化形式快速搜索?





应该将主数据库进行非规范化处理,但应用程序级别的归一化视图可以快速数据库操作?



或其他方法?

解决方案

加入的打击经常被高估。像Oracle这样的数据库产品是非常有效的加入。当真正的罪魁祸首是一个不好的数据模型或者较差的索引策略时,联盟通常被认为是表现不佳。人们还会忘记,非正规化数据库在插入或更新数据时的表现非常糟糕。



要记住的关键是要构建的应用程序类型。大多数着名网站不像常规企业应用。这就是为什么Google,Facebook等不使用关系数据库。最近有很多关于这个话题的讨论,哪些我已经博客了约



因此,如果您正在建立一个主要关于提供半结构化内容的网站,您可能不想使用关系数据库,非正规化或其他。但是,如果您正在建立一个高度交易的网站(如在线银行),则需要一种保证数据安全性和完整性的设计,并且运行良好。这意味着至少第三正常形式的关系数据库。


What are the best practices for database design and normalization for high traffic websites like stackoverflow?

Should one use a normalized database for record keeping or a normalized technique or a combination of both?

Is it sensible to design a normalized database as the main database for record keeping to reduce redundancy and at the same time maintain another denormalized form of the database for fast searching?

or

Should the main database be denormalized but with normalized views at the application level for fast database operations?

or some other approach?

解决方案

The performance hit of joining is frequently overestimated. Database products like Oracle are built to join very efficiently. Joins are often regarded as performing badly when the real culprit is a poor data model or a poor indexing strategy. People also forget that denormalised databases perform very badly when it comes to inserting or updating data.

The key thing to bear in mind is the type of application you're building. Most of the famous websites are not like regular enterprise applications. That's why Google, Facebook, etc don't use relational databases. There's been a lot of discussion of this topic recently, which I have blogged about.

So if you're building a website which is primarily about delivering shedloads of semi-structured content you probably don't want to be using a relational database, denormalised or otherwise. But if you're building a highly transactional website (such as an online bank) you need a design which guarantees data security and integrity, and does so well. That means a relational database in at least third normal form.

这篇关于在高流量网站规范化或非规范化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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