1.关系模型:
关系模型是用于数据库管理的模型。之所以这样称呼,是因为数据是以关系的形式(即表的形式)存储的。每行都包含相关数据。表格中的这些行描述了一个真实世界的实体。要使用Python和Relational数据模型,我们需要具备SQL和Pandas的先决条件知识。 Pandas是Python库。
2.文件模型:
在文档模型中,数据以文档形式存储。文件由描述文件实际和数据的记录组成。嵌套文档可用于提供有关数据子类别的信息。文档也可以用来代表现实世界的对象。
关系模型和文档模型之间的区别:
Relational Model | Document Model | ||||
---|---|---|---|---|---|
It is row-based. | It is document-based. | ||||
Not suitable for hierarchical data storage. | Generally used for hierarchical data storage. | ||||
It consists of a predefined schema. | It consists a dynamic schema. | ||||
ACID properties are followed by this model. (Atomicity, Consistency, Isolation, and Durability). | CAP theorem are followed by this model. (Consistency, Availability, and Partition tolerance). | ||||
It is slower . | It is faster than Relational Model. | ||||
Supports complex joins. | Does Not support for complex joins. | ||||
It is column-based. | It is field-based. | They are vertically scalable | They are horizontally scalable | East replication support is not provided. | They provide easy replication support |
It is more used now-a-days to store data in database. | It is comparatively less used. |