Purpose of Database
1. Why is a Database Needed?
In modern applications, data plays a crucial role. Storing data in simple files creates many problems. Databases are needed to overcome these limitations.
- To store large volumes of data
- To manage data efficiently
- To allow multiple users to access data
- To maintain accuracy and consistency
2. Main Purposes of a Database
- Centralized data storage
- Easy data retrieval
- Data sharing among users
- Data security and privacy
- Backup and recovery
- Reduction of data redundancy
3. File System vs Database
Databases were introduced to solve the problems of traditional file systems.
Traditional File System Database System ------------------------ ------------------------- Data redundancy Minimal redundancy Poor data security High data security Difficult data access Easy and fast access No concurrency control Supports multi-user access Manual backup Automatic backup & recovery
4. Reduction of Data Redundancy
Data redundancy means duplication of data at multiple locations. A database stores data at a single place and shares it across applications.
Without Database: Student File → Name, Course Fees File → Name, Course With Database: STUDENT TABLE Name | Course | Fees
5. Maintaining Data Consistency
Consistency means that data remains correct and up-to-date across the entire system. When redundancy is reduced, consistency automatically improves.
- Single source of truth
- Automatic update propagation
6. Data Sharing
A database allows multiple users to access the same data simultaneously without conflicts.
User A ─┐
├── DATABASE ─── Shared Data
User B ─┘
7. Data Security
Databases provide security mechanisms to protect data from unauthorized access.
- User authentication
- Authorization & access control
- Data encryption
8. Backup and Recovery
Databases support automatic backup and recovery to protect data from system failure, crashes, or power loss.
- Periodic backups
- Crash recovery
- Data restoration
9. Real-Life Uses of Database
- Bank account management
- Online shopping websites
- Student information systems
- Hospital records
- Railway and airline booking
Practice Questions
- What is the purpose of a database?
- Why databases are preferred over file systems?
- Explain data redundancy.
- How does a database ensure data security?
- Explain backup and recovery.