Database Management System
Software that manages databases, providing an interface between users/applications and data while handling storage, retrieval, security, backup, and concurrent access.
Also known as: DBMS, Database Management Systems
Category: Software Development
Tags: databases, software-engineering, software-architecture, data-storage
Explanation
A Database Management System (DBMS) is software that manages databases, providing an interface between users/applications and the data. It handles storage, retrieval, security, backup, and concurrent access to data, abstracting physical storage details so users can interact with data through high-level languages like SQL without understanding how data is stored on disk.
**Core Functions**:
- **Data storage management**: Efficiently store and organize data on disk
- **Query processing**: Parse, optimize, and execute queries
- **Transaction management**: Ensure ACID properties for data integrity
- **Concurrency control**: Handle multiple simultaneous users safely
- **Security**: Authentication, authorization, and access control
- **Backup and recovery**: Protect against data loss and corruption
- **Data integrity**: Enforce constraints and relationships
**Three-Schema Architecture**:
1. **External level**: User views of the data (what users see)
2. **Conceptual level**: Logical structure of the entire database
3. **Internal level**: Physical storage details
**Types of DBMS by Data Model**:
- **Relational (RDBMS)**: Tables with rows and columns (PostgreSQL, SQLite, MySQL)
- **Document**: JSON/BSON documents (MongoDB, CouchDB)
- **Key-Value**: Simple key-value pairs (Redis, DynamoDB)
- **Graph**: Nodes and relationships (Neo4j, Amazon Neptune)
- **Wide-Column**: Column families (Cassandra, HBase)
- **Time-Series**: Optimized for time-stamped data (InfluxDB, TimescaleDB)
**Types by Architecture**:
- **Centralized**: Single server (traditional)
- **Distributed**: Data spread across multiple nodes
- **Federated**: Unified view of multiple independent databases
- **Cloud-native**: Designed for cloud deployment (Spanner, Aurora)
**Types by Use Case**:
- **OLTP**: Online Transaction Processing (fast writes, many users)
- **OLAP**: Online Analytical Processing (complex queries, reporting)
- **HTAP**: Hybrid Transactional/Analytical Processing
**Key Concepts**:
**Query Optimization**: The DBMS query optimizer chooses the most efficient execution plan by parsing queries, generating possible plans, estimating costs, and selecting the lowest-cost option.
**Buffer Management**: Caches frequently accessed data in memory using page replacement policies (LRU, Clock), write-ahead logging (WAL), and dirty page management.
**Concurrency Control**: Handles simultaneous access through pessimistic locking (lock before access), optimistic locking (check conflicts at commit), or MVCC (Multi-Version Concurrency Control).
**Recovery**: Restores data after failures using Write-Ahead Logging (WAL), checkpointing, and algorithms like ARIES.
Related Concepts
← Back to all concepts