Coder Social home page Coder Social logo

javadb's Introduction

MYDB

JAVADB is a robust and efficient relational database system using Java. Some principles are referenced from MySQL, PostgreSQL and SQLite and incorporating the following key functionalities:

  • Reliable Data Storage and Recovery: Implemented a robust storage mechanism for secure data persistence and ensured seamless data
    recovery in case of system failures or crashes.

  • Transaction Management: Implemented a serializable scheduling sequence based on the two-phase locking protocol to ensure data integrity and concurrency control. Employed the Multiversion Concurrency Control (MVCC) technique to eliminate read/write locks, allowing for efficient parallel execution of transactions. Supported multiple transaction isolation levels, including read committed and repeatable read.

  • SQL Parser and Management: Developed a comprehensive SQL statement parsing module that handles basic SQL commands. Implemented efficient field management, table management, and index management functionalities, enabling smooth data manipulation operations.

  • Socket-based Communication: Established a secure and efficient communication channel between the server and the client using Java Socket programming.

Execution Method

Please note that you need to adjust the compilation version in the pom.xml file first. If you are importing it into an IDE, change the project's compilation version to match your JDK.

To begin, execute the following command to compile the source code

mvn compile

Next, execute the following command to create a database with /tmp/mydb as the path:

mvn exec:java -Dexec.mainClass="top.yichenghu.javadb.backend.Launcher" -Dexec.args="-create C:\Users\ychu3\JAVADB\tmp\javadb"

Subsequently, start the database service with default parameters using the following command:

mvn exec:java -Dexec.mainClass="top.yichenghu.javadb.backend.Launcher" -Dexec.args="-open /tmp/mydb"

At this point, the database service is already running on the local machine's port 8888. Restart another terminal and execute the following command to start the client to connect to the database:

mvn exec:java -Dexec.mainClass="top.yichenghu.javadb.client.Launcher"

This will initiate an interactive command line where you can input SQL-like syntax; pressing Enter will send the statements to the service and display the executed results.

javadb's People

Contributors

jellal-ht avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.