📁 Distributed File Storage System

Overview

A robust distributed file storage system designed to provide scalable, fault-tolerant storage across multiple nodes. This project implements consistent hashing, data replication, and a REST API interface for file operations, ensuring high availability and data integrity even during node failures.

GitHub Repository

🎯 Project Goals

🏗️ System Architecture

The system follows a distributed architecture with the following components:

System Architecture Diagram

High-level architecture showing node communication and replication

💽 Key Features

Consistent Hashing Implementation

public class ConsistentHash {
    private final HashFunction hashFunction;
    private final int numberOfReplicas;
    private final SortedMap circle = new TreeMap<>();

    public ConsistentHash(HashFunction hashFunction, int numberOfReplicas, Collection nodes) {
        this.hashFunction = hashFunction;
        this.numberOfReplicas = numberOfReplicas;
        
        for (T node : nodes) {
            add(node);
        }
    }
    
    // Code continues...
}

Data Replication

Fault Tolerance

REST API Interface

@RestController
@RequestMapping("/api/files")
public class FileController {
    
    @PostMapping("/upload")
    public ResponseEntity uploadFile(@RequestParam("file") MultipartFile file) {
        // File upload logic
    }
    
    @GetMapping("/{fileId}")
    public ResponseEntity downloadFile(@PathVariable String fileId) {
        // File download logic
    }
    
    // Additional endpoints...
}

🛠 Technical Implementation

Backend Development

Client Application

Testing Strategy

Test Coverage Report

Test coverage showing over 90% code coverage across core components

📊 Performance Metrics

Performance Benchmark Results

Performance benchmarks showing throughput vs. number of nodes

🔧 Technologies Used

📝 Lessons Learned

🚀 Future Enhancements