Skip to content

thmsgo18/Database-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

150 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DBMS - Database Management System

Java Maven

Version française

A relational database management system developed in Java, implementing fundamental DBMS concepts: disk management, buffer manager, query processing, and relational operations.


Table of Contents


Features

Disk Management

  • DiskManager: Page allocation and management on disk
  • PageId: Unique page identification system
  • Efficient disk space management with dynamic allocation

Buffer Manager

  • In-memory cache to optimize disk access
  • Page replacement policy (LRU)
  • Dirty pages management

Relational Operations

  • Relation Scan: Sequential tuple traversal
  • Projection: Selection of specific columns
  • Join: Page-oriented join implementation
  • Filtering: Applying conditions on data

Data Management

  • CSV data import
  • Record-oriented storage
  • Iterators for efficient data traversal
  • Multiple data types support (INT, REAL, VARCHAR, CHAR)

Architecture

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)          │
└─────────────────────────────────┘

Prerequisites

  • Java: Version 17 or higher
  • Maven: Version 3.6 or higher
  • Operating System: Linux or macOS (recommended)

Check installations

# Check Java
java -version

# Check Maven
mvn -version

Installation

1. Clone the repository

git clone https://github.com/thmsgo18/projet-bdda.git
cd projet-bdda

2. Compile the project

mvn clean compile

3. Make the script executable

chmod +x run.sh

Usage

Default mode

Uses the default configuration file file-config.json:

./run.sh

Custom mode

Specify a custom configuration file:

./run.sh path/to/configuration.json

Configuration file

Example structure of file-config.json:

{
  "dbpath": "DataBase",
  "pagesize": 4096,
  "dm_maxfilesize": 100,
  "bm_buffercount": 2,
  "bm_policy": "LRU"
}

Parameters:

  • dbpath: Database directory path
  • pagesize: Page size in bytes
  • dm_maxfilesize: Maximum number of pages per file
  • bm_buffercount: Number of frames in the buffer
  • bm_policy: Replacement policy (LRU recommended)

Project Structure

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

Authors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •