Skip to content

Gowtham0748/RDBMS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

🗄️ NITCBase — Relational Database Management System

A fully implemented mini RDBMS built from scratch in C++ — disk, buffer, cache, indexing, and an interactive command interface included.


📌 Overview

NITCBase is a fully implemented mini Relational Database Management System (RDBMS) built from scratch in C++, developed as part of a laboratory course at NIT Calicut. It covers every internal layer of a real database engine — from disk simulation and buffer management to B+ Tree indexing and an interactive command-line interface.

This project is designed for educational purposes, providing hands-on experience with how a database works under the hood.

✨ Highlights

  • 🖴  Simulated 16MB disk with block-level I/O
  • ⚡  32-block buffer pool for fast in-memory access
  • 🗂️  Relation & attribute cache for up to 12 open relations
  • 🌲  B+ Tree indexing for efficient attribute-based search
  • 🔍  Relational algebra — select, project, insert, and join
  • 💬  Custom command-line interface with SQL-like syntax and batch script support
  • 📦  12 stages completed end-to-end

Architecture Design

NITCBase Architecture

🔄 How It Works

User Command → Frontend Interface → Schema / Algebra → Block Access → B+ Tree / Cache → Buffer → Disk

Each layer only talks to the one below it — a clean, real-world DBMS design.


📋 Table of Contents


🛠️ Prerequisites

Before running NITCBase, ensure you have the following installed:

  • Linux-based OS (tested on Ubuntu 20.04)
  • C/C++ compiler (gcc / g++)
  • make
  • libreadline-dev
  • git

Install all required packages with:

sudo apt-get install build-essential libreadline-dev git

🚀 Getting Started

Installation

  1. Clone the repository:

    git clone https://github.com/Gowtham0748/RDBMS
  2. Navigate to the project directory:

    cd NITCBase/mynitcbase
  3. Build the application:

    make

    If you run into build issues, make sure all prerequisites are properly installed.

Running NITCBase

./nitcbase

This starts the interactive command-line interface where you can run NITCBase commands directly.


💻 Usage

NITCBase provides a custom command-line interface with SQL-like syntax for performing database operations:

-- Create and manage tables
CREATE TABLE Students (RollNo NUM, Name STR, CGPA NUM);
OPEN TABLE Students;

-- Insert and query data
INSERT INTO Students VALUES (1, Alice, 9.5);
SELECT * FROM Students INTO Temp WHERE CGPA >= 9.0 INTO TopStudents;

-- Close table
CLOSE TABLE Students;

-- Indexing
CREATE INDEX ON Students.RollNo;

-- Join two relations
SELECT * FROM Students JOIN Courses INTO Temp WHERE Students.RollNo = Courses.RollNo;

-- Run a batch script
RUN myscript.txt;

Note: NITCBase uses its own command syntax. Commands may look similar to SQL but are not standard SQL — for example, SELECT requires an INTO target relation.

For the complete list of supported commands, refer to the NITCBase User Interface Documentation.


📖 NITCBase Documentation

For detailed information on the architecture, design, and all supported features:

📚 NITCBase Official Documentation


🤝 Contributing

Contributions are welcome! If you'd like to improve NITCBase:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -m 'Add some feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. Open a Pull Request

Please follow clear naming conventions and include a short description of your changes.


Thank you for checking out NITCBase! If you run into any issues or have questions, feel free to open an issue.

About

This project implements a custom Relational Database Management System (RDBMS) built from scratch in C++, covering core functionalities such as table creation, data insertion, retrieval, B+ Tree indexing, and relational operations like select, project, and join — all through a layered architecture and a custom command-line interface.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages