๐Ÿ“ฆ keyurkhant / light-db

โ˜… 0 stars โ‘‚ 0 forks ๐Ÿ‘ 0 watching
๐Ÿ“ฅ Clone https://github.com/keyurkhant/light-db.git
HTTPS git clone https://github.com/keyurkhant/light-db.git
SSH git clone git@github.com:keyurkhant/light-db.git
CLI gh repo clone keyurkhant/light-db
Keyur Khant Keyur Khant fixes 76e046f 1 years ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ database
๐Ÿ“ src
๐Ÿ“„ .DS_Store
๐Ÿ“„ .gitignore
๐Ÿ“„ pom.xml
๐Ÿ“„ README.md
๐Ÿ“„ README.md

Lightweight Database Management System using Java

The goal of this project is to create a simple database management system (DBMS) using Java. The DBMS should be lightweight and able to handle different types of queries, like creating and modifying the database structure (DDL) and manipulating data (DML). The data will be stored in TXT files, and there will be a security feature for authentication. An interesting addition is the transaction processing feature, which ensures that data changes are consistent, isolated, durable, and atomic. This report will provide an overview of the implemented DBMS, highlighting its main features, design choices, and functionality.

File structure:

.
โ””โ”€โ”€ LightDB/
    โ”œโ”€โ”€ database/
    โ”‚ โ”œโ”€โ”€ tables/
    โ”‚ โ”‚   โ””โ”€โ”€ employee.txt
    โ”‚ โ”œโ”€โ”€ tables-metadata/
    โ”‚ โ”‚   โ””โ”€โ”€ employee_metadata.txt
    โ”‚ โ””โ”€โ”€ users.txt
    โ””โ”€โ”€ src/
        โ””โ”€โ”€ main/
            โ””โ”€โ”€ java/
                โ””โ”€โ”€ database/
                    โ”œโ”€โ”€ auth/
                    โ”‚   โ”œโ”€โ”€ IAuth.java
                    โ”‚   โ””โ”€โ”€ Auth.java
                    โ”œโ”€โ”€ query/
                    โ”‚   โ”œโ”€โ”€ IQueryHandler.java
                    โ”‚   โ”œโ”€โ”€ IQueryManager.java
                    โ”‚   โ”œโ”€โ”€ QueryHandler.java
                    โ”‚   โ”œโ”€โ”€ QueryManager.java
                    โ”‚   โ””โ”€โ”€ QueryUtils.java
                    โ”œโ”€โ”€ user/
                    โ”‚   โ”œโ”€โ”€ User.java
                    โ”‚   โ””โ”€โ”€ UserManager.java
                    โ”œโ”€โ”€ utils/
                    โ”‚   โ””โ”€โ”€ Utils.java
                    โ””โ”€โ”€ Main.java

Here, I have followed the above structure in which code is segregated into various classes and all data is stored in a database directory in LightDB.

  • The UserManager class is a part of the lightweight database management system (DBMS)
implementation in Java. It is responsible for managing user-related operations and authentication within the DBMS.
  • The QueryManager class is a key component of the lightweight database management system
(DBMS) implementation in Java. It handles the execution and management of different types of queries within the DBMS.
  • The QueryHandler class is a part of the lightweight database management system (DBMS)
implementation in Java. It is responsible for handling and executing individual queries received by the system.
  • The QueryHandler class interacts with the QueryManager and other relevant components to
process the query. It translates the query into appropriate database operations and ensures their successful execution.
  • The Auth class interacts with the user management module, such as the UserManager, to validate
user credentials during the login process. It securely stores and compares user passwords to ensure authentication accuracy.
  • In the database directory, users.txt contains all user credentials. Furthermore, tables contain all
database tables and table-metadata contains column fields of the specific tables.

Note: Throughout the application development, I have used Java W3 documentation pattern to add class and method commenting.