What is DBMS?
Contents
What is a Database?
A Database is an organized collection of data that can be easily accessed, managed, and updated. It is like a digital locker where your data is stored in a structured way.
What is a Database Management System (DBMS)?
A DBMS is a software system that interacts with users, applications, and the database itself to capture and analyze data.
It provides the tools to:
- Define (create tables, schemas, etc.)
- Manipulate (insert, update, delete)
- Retrieve (querying using SQL)
- Control access (authorization, backup)
Why do we need a DBMS?
Need | Explanation |
---|---|
Data Redundancy Control | Avoid storing same data at multiple places |
Data Consistency | Single update changes data everywhere |
Efficient Data Access | Fast and optimized querying |
Data Integrity | Ensures accuracy with constraints (e.g. unique, not null) |
Data Security | Users can be given restricted access (only view, no delete) |
Backup and Recovery | Can restore data after crash or failure |
Multi-User Access Control | Multiple people can access database safely at same time |
Abstraction | Hides internal data structure, shows only necessary info (logical view) |
Types of DBMS
- Hierarchical DBMS
- Network DBMS
- Relational DBMS (RDBMS)
- Object-Oriented DBMS
- NoSQL DBMS (Non-relational)
We moved from one to another because of increasing data complexity, need for flexibility, and better performance.
Hierarchical DBMS
- Data is stored in tree-like structure.
- Each record has only one parent and can have multiple children.
- Think like a file system (C:\Folder\Subfolder\Files)
Example:
- An employee record belongs to one department, and each department has multiple employees.
Pros:
- Easy to navigate with parent-child links.
- Fast access if hierarchy is known.
Cons:
- Very rigid.
- Difficult to reorganize structure.
- Doesn’t support complex relationships (e.g. many-to-many).
Example DBMS: IBM’s IMS
Network DBMS
- Extension of hierarchical model.
- Records can have multiple parents and multiple children.
- Uses pointers (like graphs) to define relationships.
Example:
- A student can enroll in multiple courses, and each course can have many students.
Pros:
- More flexible than hierarchical.
- Handles complex relationships.
Cons:
- Still needs predefined structure.
- Data access via pointers is complex to manage.
Example DBMS: Integrated Data Store (IDS)
Relational DBMS (RDBMS)
- Introduced by E.F. Codd in 1970 (revolutionary idea!)
- Stores data in tables (relations).
- Tables have rows (records) and columns (fields).
- Uses SQL (Structured Query Language) for operations.
Example:
- A Users table with columns: ID, Name, Email
- A Orders table with columns: OrderID, UserID, Amount
- We can join tables using keys (UserID)
Pros:
- Simple and powerful querying with SQL.
- Data independence and integrity.
- Widely adopted and supported.
Cons:
- Not ideal for very complex or hierarchical data.
- Slower for huge scale data (billions of rows).
- Relational constraints add overhead.
Example DBMS: MySQL, PostgreSQL, Oracle, MS SQL Server
Object-Oriented DBMS (OODBMS)
- Stores data as objects, like in Object-Oriented Programming.
- Each object contains both data and methods.
- Useful when your app is written in OOP languages like Java, Python, C++
Example:
- An object Car with attributes (color, model) and methods (start(), stop())
Pros:
- Great for complex data like CAD, multimedia, engineering.
- Matches programming model.
Cons:
- Not easy for traditional data analytics.
- Slower adoption.
Example DBMS: db4o, ObjectDB
NoSQL DBMS (Non-relational)
- Designed for Big Data, real-time web apps, and scalability.
- Doesn’t require fixed schema.
- Handles unstructured, semi-structured data (JSON, XML, etc.)
- 4 Types:
- Key-Value Store (Redis)
- Document Store (MongoDB)
- Column Store (Cassandra)
- Graph DB (Neo4j)
Example:
- MongoDB stores: { “_id”: 1, “name”: “Alice”, “orders”: [ {“item”: “Book”, “price”: 250}, {“item”: “Pen”, “price”: 20} ] }
Pros:
- Highly scalable and fast.
- Flexible data formats.
- Great for distributed systems and cloud-based apps.
Cons:
- Less standardization.
- ACID compliance not guaranteed (eventual consistency instead).
- Querying is not as powerful as SQL for relational data.
Why the Transition?
From | To | Reason |
---|---|---|
Hierarchical | Network | Needed to support many-to-many relationships |
Network | Relational | Simplify access, reduce complexity, and use SQL |
Relational | Object | Needed support for complex, non-tabular data (images, multimedia) |
Object | NoSQL | Need to handle large-scale, unstructured, distributed data |
Real-World Use Cases
- RDBMS: Banking systems, ERP software, online shopping (Amazon orders)
- NoSQL: Social media apps (Instagram, Facebook), IoT devices, recommendation engines
- OODBMS: CAD/CAM tools, scientific applications
Summary Table:
DBMS Type | Structure | Best For | Example |
---|---|---|---|
Hierarchical | Tree | Organization charts | IBM IMS |
Network | Graph | Complex inter-linked data | IDS |
Relational | Table | Most business apps | MySQL, Oracle |
Object-Oriented | Objects | OOP-heavy apps | db4o, ObjectDB |
NoSQL | Flexible Docs | Big Data, scalable web apps | MongoDB, Redis |