Database Models in DBMS
Introduction
A database model defines how data is structured, stored, and managed in a database. Different database models are used based on application needs, scalability, and performance requirements.
There are several types of database models, including:
- Hierarchical Model
- Network Model
- Relational Model (Most Common)
- Object-Oriented Model
- Document-Oriented Model (NoSQL)
- Key-Value Model (NoSQL)
- Columnar Model (NoSQL)
- Graph Model (NoSQL)
1. Hierarchical Database Model
๐น Structure: Organizes data in a tree-like hierarchy (parent-child relationship).
๐น How it Works:
- Each parent node can have multiple child nodes.
- A child node cannot have multiple parents (one-to-many relationship).
- Navigation is done using pointers.
๐น Example: - A file system where folders (parents) contain subfolders or files (children).
- IBM Information Management System (IMS).
๐ก Limitations:
โ Complex queries are difficult due to rigid structure.
โ Duplication of data leads to inefficiency.
2. Network Database Model
๐น Structure: Extends the hierarchical model by allowing many-to-many relationships.
๐น How it Works:
- Uses graphs of records where each record can have multiple parents and children.
- Relationships are implemented with pointers or links.
๐น Example: - Integrated Data Store (IDS), used in early telecom databases.
๐ก Advantages:
โ
Supports complex relationships between data.
โ
More flexible than hierarchical models.
๐ก Limitations:
โ Requires complex pointers, making updates difficult.
โ Not widely used in modern databases.
3. Relational Database Model (RDBMS) โ Most Common
๐น Structure: Data is stored in tables (rows & columns) with relationships between them.
๐น How it Works:
- Tables have primary keys to uniquely identify records.
- Uses foreign keys to establish relationships between tables.
- Accessed using Structured Query Language (SQL).
๐น Examples: - MySQL, PostgreSQL, Oracle, Microsoft SQL Server.
- E-commerce websites storing customer orders.
๐ก Advantages:
โ
Data integrity through ACID properties.
โ
Easy to retrieve and manage data using SQL.
โ
Widely used in business applications.
๐ก Limitations:
โ Can become slow when handling huge datasets.
โ Scaling requires expensive hardware (vertical scaling).
4. Object-Oriented Database Model (OODBMS)
๐น Structure: Stores data as objects, similar to Object-Oriented Programming (OOP).
๐น How it Works:
- Each object has attributes (data) and methods (functions).
- Supports inheritance, encapsulation, and polymorphism.
๐น Example: - ObjectDB, db4o โ Used in CAD systems, multimedia applications.
๐ก Advantages:
โ
Efficient for complex data types like images and videos.
โ
Works well with OOP languages like Java, C++.
๐ก Limitations:
โ Not optimized for simple queries.
โ Less popular than relational databases.
5. Document-Oriented Database Model (NoSQL)
๐น Structure: Stores data as JSON, BSON, or XML documents instead of tables.
๐น How it Works:
- Each document contains key-value pairs, arrays, and nested data.
- No strict schema โ flexible for unstructured data.
๐น Examples: - MongoDB, CouchDB โ Used in social media and content management.
๐ก Advantages:
โ
Highly scalable (horizontal scaling).
โ
Ideal for big data and real-time applications.
๐ก Limitations:
โ Not ACID-compliant by default.
โ Complex queries are harder than in SQL databases.
6. Key-Value Database Model (NoSQL)
๐น Structure: Stores data as key-value pairs.
๐น How it Works:
- Each record consists of a unique key and its associated value.
- Values can be simple data types or complex objects.
๐น Examples: - Redis, Amazon DynamoDB โ Used in caching, session storage.
๐ก Advantages:
โ
Ultra-fast retrieval using keys.
โ
Best for caching, real-time applications.
๐ก Limitations:
โ Not ideal for complex queries.
โ Data relationships are difficult to manage.
7. Column-Oriented Database Model (NoSQL)
๐น Structure: Stores data in columns instead of rows.
๐น How it Works:
- Each column family stores related data together for fast access.
- Designed for big data analytics.
๐น Examples: - Apache Cassandra, HBase โ Used in analytics, data warehouses.
๐ก Advantages:
โ
Faster for read-heavy workloads.
โ
Highly scalable.
๐ก Limitations:
โ Not ideal for transactional applications.
โ More complex to design than relational databases.
8. Graph Database Model (NoSQL)
๐น Structure: Stores data as nodes and edges, representing relationships.
๐น How it Works:
- Nodes represent entities (e.g., people, places).
- Edges represent relationships (e.g., “friend of”, “likes”).
๐น Examples: - Neo4j, ArangoDB โ Used in social networks, fraud detection.
๐ก Advantages:
โ
Efficient for relationship-based queries.
โ
Ideal for recommendation engines, fraud detection.
๐ก Limitations:
โ Not optimized for simple transactions.
โ Limited adoption compared to SQL databases.
Comparison Table: Database Models
| Model | Structure | Best For | Examples |
|---|---|---|---|
| Hierarchical | Tree-like (parent-child) | File systems, legacy apps | IBM IMS |
| Network | Graph-like (many-to-many) | Telecom, complex relationships | IDS |
| Relational (RDBMS) | Tables (rows & columns) | Business apps, finance | MySQL, PostgreSQL |
| Object-Oriented | Objects (OOP-based) | Multimedia, CAD | ObjectDB |
| Document-Oriented (NoSQL) | JSON-like documents | Web apps, content management | MongoDB |
| Key-Value (NoSQL) | Key-value pairs | Caching, real-time data | Redis, DynamoDB |
| Columnar (NoSQL) | Column families | Big data analytics | Cassandra, HBase |
| Graph (NoSQL) | Nodes & edges | Social media, fraud detection | Neo4j |
Conclusion
Choosing the right database model depends on your application’s needs.
- Use RDBMS for structured data and transactional systems.
- Use NoSQL for scalability, big data, and real-time applications.
- Use Graph databases for highly connected data.
