数据库 - 扁平化与规范化
当数据库“扁平化”与标准化时,它们意味着什么?
what do they mean when a database is “flattened out” vs. normalized?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
当数据库“扁平化”与标准化时,它们意味着什么?
what do they mean when a database is “flattened out” vs. normalized?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
“扁平化”通常是指只有一个(或几个)非常大的表的数据库。
“标准化”是指数据是否已组织成结构良好的相关表。这通常会通过将值拉入单独的表并通过 ID 与其关联来减少表中各行之间的值重复。
有关详细信息,请参阅数据库规范化。
"Flattened out" typically refers to a database where you have a single (or few) very large tables.
"Normalized" refers to whether the data has been organized into well structured, related tables. This typically reduces duplication of values across rows in a table by pulling the values into a separate table, and relating to it by ID.
For details, see Database Normalization.
规范化数据库的组织方式是为了最大限度地减少数据冗余并通常通过相关表生成小型且结构良好的关系。一个例子可能是客户和他/她的所有订单。在规范化数据库中,您将至少有两个(也可能更多)表。客户表和订单表以某种方式连接在一起。在扁平结构中,客户和订单数据可能位于单个表中。
报告数据库倾向于非规范化,以允许更快地检索数据(可能需要许多联接),而生产或事务数据库 (OLTP) 倾向于(或应该)通过表之间建立的外键更加规范化。
A normalized database is one that is organized to minimize redundancy of data and to produce small and well structured relationships, normally via related tables. An example might be a customer and all his/her orders. In a normalized database, you would have at least two (and probably more) tables. A customer table and an orders table, joined together in some fashion. In a flattened structure, customer and order data might be in a single table.
Reporting databases tend to be denormalized to allows quicker retrieval of data (where many joins may be required), whereas production or transactional databases (OLTP) tend to be (or should be) more normalized with foreign keys established between tables.