A scalable and fault-tolerant Distributed File System built using Go and gRPC. This system allows uploading, downloading, and replicating files across multiple distributed storage nodes.
- 📤 Upload files to distributed nodes
- 📥 Download files using parallel chunking
- 🔁 Automatic replication for fault tolerance
- ❤️ Heartbeat mechanism for node health monitoring
- ⚡ Concurrent file transfer for better performance
The system is composed of three main components:
- Maintains metadata of files and nodes
- Assigns nodes for uploads and downloads
- Monitors node health using heartbeats
- Handles replication logic
- Stores files locally
- Handles upload and download requests
- Replicates files to other nodes
- Sends periodic heartbeat signals to master
- Uploads files to the system
- Downloads files from multiple nodes in parallel
Distributed_File_System/
│
├── master_tracker/ # Master node logic
├── data_keeper/ # Storage node implementation
├── client/ # Client operations
├── dfs/ # Protobuf definitions
└── README.md
Make sure you have the following installed:
- Go
- Protocol Buffers (protoc)
- gRPC dependencies
cd master_tracker
go run main.goRuns on:
localhost:3000
cd data_keeper
go run main.go <MasterAddress>Example:
go run main.go localhost:3001💡 You can start multiple nodes for better replication and fault tolerance.
cd client
go run main.go <master_address> <upload|download> <filename> [local_filepath]go run main.go localhost:3000 upload myfile.txt ./myfile.txtgo run main.go localhost:3000 download myfile.txtOr specify a custom save path:
go run maint.go localhost:3000 download myfile.txt ./downloads/myfile.txt- Each file is replicated to up to 3 nodes
- Replication is triggered automatically by the master
- Ensures availability even if nodes fail
- Data nodes send heartbeat every 1 second
- Master marks nodes as dead after 3 seconds of inactivity
- File is split into chunks
- Each node serves a chunk
- Client downloads chunks concurrently and reconstructs the file