A relational database management system developed in Java, implementing fundamental DBMS concepts: disk management, buffer manager, query processing, and relational operations.
- DiskManager: Page allocation and management on disk
- PageId: Unique page identification system
- Efficient disk space management with dynamic allocation
- In-memory cache to optimize disk access
- Page replacement policy (LRU)
- Dirty pages management
- Relation Scan: Sequential tuple traversal
- Projection: Selection of specific columns
- Join: Page-oriented join implementation
- Filtering: Applying conditions on data
- CSV data import
- Record-oriented storage
- Iterators for efficient data traversal
- Multiple data types support (INT, REAL, VARCHAR, CHAR)
The project follows a modular layered architecture:
┌─────────────────────────────────┐
│ User Interface │
│ (Sgbd.java) │
└─────────────────────────────────┘
↓
┌─────────────────────────────────┐
│ Query Layer │
│ (DBManager, Operators) │
└─────────────────────────────────┘
↓
┌─────────────────────────────────┐
│ Relational Layer │
│ (Relation, Record, ColInfo) │
└─────────────────────────────────┘
↓
┌─────────────────────────────────┐
│ Buffer Manager │
│ (BufferManager.java) │
└─────────────────────────────────┘
↓
┌─────────────────────────────────┐
│ Disk Manager │
│ (DiskManager, PageId) │
└─────────────────────────────────┘
- Java: Version 17 or higher
- Maven: Version 3.6 or higher
- Operating System: Linux or macOS (recommended)
# Check Java
java -version
# Check Maven
mvn -versiongit clone https://github.com/thmsgo18/projet-bdda.git
cd projet-bddamvn clean compilechmod +x run.shUses the default configuration file file-config.json:
./run.shSpecify a custom configuration file:
./run.sh path/to/configuration.jsonExample structure of file-config.json:
{
"dbpath": "DataBase",
"pagesize": 4096,
"dm_maxfilesize": 100,
"bm_buffercount": 2,
"bm_policy": "LRU"
}Parameters:
dbpath: Database directory pathpagesize: Page size in bytesdm_maxfilesize: Maximum number of pages per filebm_buffercount: Number of frames in the bufferbm_policy: Replacement policy (LRU recommended)
projet-bdda/
├── src/main/java/
│ ├── buffer/ # Cache management
│ │ └── BufferManager.java
│ ├── espaceDisque/ # Disk management
│ │ ├── DiskManager.java
│ │ ├── PageId.java
│ │ └── DBConfig.java
│ ├── relationnel/ # Relational model
│ │ ├── Relation.java
│ │ ├── Record.java
│ │ └── ColInfo.java
│ ├── requete/ # Query processing
│ │ ├── DBManager.java
│ │ ├── RelationScanner.java
│ │ ├── ProjectOperator.java
│ │ └── PageOrientedJoinOperator.java
│ ├── test/ # Unit tests
│ ├── Sgbd.java # Main entry point
│ └── Main.java
├── file-config.json # Default configuration
├── run.sh # Execution script
├── pom.xml # Maven configuration
└── README.md