- Mastering MongoDB 3.x
- Alex Giamas
- 252字
- 2021-08-20 10:10:49
Relational schema design
In relational databases, we design with the goal of avoiding anomalies and redundancy. Anomalies can happen when we have the same information stored in multiple columns; we update one of them but not the rest and we end up with conflicting information for the same column of information. An anomaly can also happen when we cannot delete a row without losing information that we need, possibly in other rows referenced by it. Data redundancy can happen when our data is not in a normal form, but has duplicate data across different tables, which can lead to data inconsistency and is difficult to maintain.
In relational databases, we use normal forms to normalize our data. Starting from the basic 1NF (first normal form), onto the 2NF, 3NF, and BCNF, we model our data taking functional dependencies into account and, if we follow the rules, we can end up with many more tables than domain model objects.
In practice, relational database modeling is often driven by the structure of the data that we have. In web applications following some sort of MVC model pattern, we will model our database according to our models, which are modeled after the UML diagram conventions. Abstractions such the ORM for Django or the Active Record for Rails help application developers abstract database structure to object models. Ultimately, many times we end up designing our database based on the structure of the available data. Thus, we are designing around the answers that we can have.
- 大數(shù)據(jù)導(dǎo)論:思維、技術(shù)與應(yīng)用
- Ansible Configuration Management
- 亮劍.NET:.NET深入體驗(yàn)與實(shí)戰(zhàn)精要
- 計(jì)算機(jī)圖形學(xué)
- Java開發(fā)技術(shù)全程指南
- 離散事件系統(tǒng)建模與仿真
- 自主研拋機(jī)器人技術(shù)
- Python Data Science Essentials
- Windows內(nèi)核原理與實(shí)現(xiàn)
- 大數(shù)據(jù)平臺(tái)異常檢測(cè)分析系統(tǒng)的若干關(guān)鍵技術(shù)研究
- 工業(yè)機(jī)器人維護(hù)與保養(yǎng)
- Linux嵌入式系統(tǒng)開發(fā)
- 水晶石影視動(dòng)畫精粹:After Effects & Nuke 影視后期合成
- Machine Learning Algorithms(Second Edition)
- Hands-On Dashboard Development with QlikView