Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Aptitude
  • Engineering Mathematics
  • Discrete Mathematics
  • Operating System
  • DBMS
  • Computer Networks
  • Digital Logic and Design
  • C Programming
  • Data Structures
  • Algorithms
  • Theory of Computation
  • Compiler Design
  • Computer Org and Architecture
Open In App
Next Article:
Difference between E-R Model and Relational Model in DBMS
Next article icon

Difference between Relational model and Document Model

Last Updated : 10 Sep, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

The relational model organizes data into tables with rows and columns, ideal for structured data. On the other hand, the document model stores data in hierarchical documents, which offers more flexibility for managing unstructured or semi-structured data. Both models serve different purposes in database management.

What is the Relational Model?

The relational model is a model for the management of the database. It is called so because the data is stored in the form of relations i.e., in the form of tables. Every row consists of related data. These rows in the table depict a real-world entity. To work with Python and the Relational data model we need a prerequisite knowledge of - SQL and Pandas. Panda is a library of Python. 

Advantages

  • It uses a predefined schema, which ensures data integrity.
  • Supports complex joins for querying related data.
  • Follows ACID properties, which ensures reliable transactions.

Disadvantages

  • It is Less suitable for hierarchical or unstructured data.
  • It is slower due to the need for complex joins and rigid schema.

What is the Document Model?

In the document model, the data is stored in the form of documents. The documents consist of the records which describe the actual data of the document. A nested document can be used to provide information about subcategories of the data. The document can also be used to represent real-world objects. 

Advantages

  • It Offers a dynamic schema, allowing for flexible data storage.
  • Generally faster for read and write operations due to its document-based structure.
  • Supports easy replication and horizontal scalability.

Disadvantages

  • Lacks support for complex joins.
  • Does not follow strictly to ACID properties, it follows the CAP theorem.

Difference Between Relational and Document Model

Relational ModelDocument 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 scalableThey are horizontally scalable
Fast 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.
To add attributes in a relational model, database schema needs to be modified for including additional columns and their data types.In a document-based database, you need to add additional key-value pairs in the document for representing new fields.

Conclusion

The relational model is in environments where data integrity and complex querying are most important, while the document model is for applications which require flexible, hierarchical data storage and rapid scaling.


Next Article
Difference between E-R Model and Relational Model in DBMS

R

rajatrathi
Improve
Article Tags :
  • DBMS
  • Difference Between
  • DBMS-Relational Model

Similar Reads

  • Difference between E-R Model and Relational Model in DBMS
    In database management systems (DBMS), two key methods are the Relational model and the Entity-Relationship (E-R) model. Each has a specific function in the development and operation of databases. While the Relational model provides the practical structure for organizing and managing data in relatio
    4 min read
  • Difference between Prototype Model and Incremental Model
    The Prototype Model focuses on creating a preliminary version of the software to refine based on user feedback, ideal for projects with unclear requirements. The Incremental Model builds the software in small, manageable sections, adding functionality in each cycle, suitable for projects needing ste
    3 min read
  • Difference between Network and Relational data model
    Data models specify the organization, archiving, and manipulation of data in database management systems (DBMSs). The Network Data Model and the Relational Data Model are two popular forms of data models. Each of these models has distinct characteristics, benefits, and uses for organizing and managi
    5 min read
  • Difference between Relation and Function
    A relation in mathematics is simply a connection or a rule that links one set of things (called the domain) to another set of things (called the range). You can think of it as a collection of pairs that shows how items from one group are connected to items in another group. For example, Imagine you
    6 min read
  • Difference between Prototype Model and RAD Model
    1. Prototype Model : The prototype model is a software development life cycle model which is used when the customer is not known completely about how the end product should be and its requirements. So in this model, a prototype of the end product is first developed by the developers and then tested
    2 min read
  • Difference Between ER Modeling and Dimensional Modeling
    A logical view of data is provided by the high-level conceptual data model known as the Entity-Relationship (ER) model, which represents entities, characteristics, and relationships. It is necessary to create databases that are well-structured. Ralph Kimball invented dimensional modeling, which comb
    5 min read
  • Difference between Relational database and NoSQL
    1. Relational Database : RDBMS stands for Relational Database Management Systems. It is most popular database. In it, data is store in the form of row that is in the form of tuple. It contain numbers of table and data can be easily accessed because data is store in the table. This Model was proposed
    2 min read
  • Difference Between Hierarchical, Network and Relational Data Model
    In order to define the connections, organization, and structure of data in a database management system (DBMS), data models are essential. The effectiveness of a database's ability to store, retrieve, and alter data is greatly influenced by the choice of data model. The Hierarchical, Network, and Re
    6 min read
  • Difference between MongoDB and Amazon DocumentDB
    1. MongoDB : MongoDB is an open-source document-oriented database used for high volume data storage. It falls under classification of NoSQL database. NoSQL tool means that it doesn’t utilize usual rows and columns. MongoDB uses BSON (document storage format) which is binary style of JSON documents.
    2 min read
  • Difference between MongoDB and Teradata
    1. MongoDB : MongoDB is an open-source document-oriented database used for high volume data storage. It falls under classification of NoSQL database. NoSQL tool means that it doesn’t utilize usual rows and columns. MongoDB uses BSON (document storage format), which is a binary style of JSON document
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences