在数据库方面,是“为了正确性而规范化,为了性能去规范化";正确的咒语? [英] In terms of databases, is "Normalize for correctness, denormalize for performance" a right mantra?

查看:23
本文介绍了在数据库方面,是“为了正确性而规范化,为了性能去规范化";正确的咒语?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

规范化会带来许多基本和理想的特征,包括审美愉悦.此外,它在理论上也是正确的".在这种情况下,非规范化被用作一种折衷,一种实现性能的校正.除了性能之外,还有其他原因可以对数据库进行非规范化吗?

Normalization leads to many essential and desirable characteristics, including aesthetic pleasure. Besides it is also theoretically "correct". In this context, denormalization is applied as a compromise, a correction to achieve performance. Is there any reason other than performance that a database could be denormalized?

推荐答案

非规范化的两个最常见原因是:

The two most common reasons to denormalize are:

  1. 性能
  2. 无知

前者应通过分析进行验证,而后者应通过卷起的报纸进行更正;-)

The former should be verified with profiling, while the latter should be corrected with a rolled-up newspaper ;-)

我想说一个更好的口头禅是为了正确性而规范化,为了速度去规范化——并且仅在必要时"

I would say a better mantra would be "normalize for correctness, denormalize for speed - and only when necessary"

这篇关于在数据库方面,是“为了正确性而规范化,为了性能去规范化";正确的咒语?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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