Skip to content

A Java-based console application that simulates a command-driven data processing system using custom implementations of key data structures like HashMap, LinkedList, and PriorityQueue. Designed for efficient storage, retrieval, and manipulation of dynamic data entries.

Notifications You must be signed in to change notification settings

mihaelacoman1/DistributedDocDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DistributedDocDB - Simple Distributed Document Storage System

DistributedDocDB is a Java-based client-server application designed to store, retrieve, and delete files remotely over a network. This project demonstrates key concepts of concurrent programming and TCP socket communication by allowing multiple clients to interact with the server simultaneously.

Idea/Workflow

DistributedDocDB is my little experiment in making document storage simple and interactive. The server keeps all files in a dedicated data/ folder, while clients can connect and use commands like PUT or GET to save and retrieve files. The goal is to see concurrency, networking, and file management working together in a real project — and it’s still evolving with upcoming features like LIST and REPLACE to make managing files even easier.

Upcoming Features / Adjustments

The following commands are planned additions to improve file management. They are not yet implemented but are part of ongoing development:

  • LIST: Will display all files currently stored in the server’s data/ directory. This will help users quickly see which files exist on the server.
  • REPLACE <new_content>: Will replace the content of an existing file without creating a new one if it does not exist. This ensures safe updates to existing files without accidental creation of new files.

Features

  • PUT : Upload and save a file with specified content to the server.
  • GET : Retrieve the content of a file from the server.
  • DELETE : Remove a file from the server’s storage.
  • EXIT: Close the client connection gracefully.

Architecture

  • Server (DistributedDocDBServer.java):
    Listens on a TCP port, accepts client connections, processes commands, and manages file storage under the data/ directory.

  • Client (Client.java):
    Provides a command-line interface to send commands to the server and display server responses.

  • Supporting classes (Task.java, WorkerThread.java):
    Handle client requests and server concurrency.

Setup and Running

Prerequisites

  • Java Development Kit (JDK) 8 or later installed
  • Basic terminal/command line knowledge

Steps

  1. Clone the repository:

    git clone https://github.com/mihaelacoman1/DataStructureEngine
    cd DataStructureEngine
  2. Compile the Java files:

    javac project/*.java
  3. Create the data directory to store files:

    mkdir data
  4. Start the server (keep this terminal open):

    java project.DistributedDocDBServer
  5. Open a new terminal and start the client:

    java project.Client
  6. Use the client commands as prompted:

    • PUT <filename> <content>
    • GET <filename>
    • DELETE <filename>
    • EXIT

Example Usage

PUT test.txt HelloWorld
GET test.txt
DELETE test.txt
EXIT

About

A Java-based console application that simulates a command-driven data processing system using custom implementations of key data structures like HashMap, LinkedList, and PriorityQueue. Designed for efficient storage, retrieval, and manipulation of dynamic data entries.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages