A work-in-progress distributed file storage system built from first principles in Go.
This project focuses on understanding networking, systems design, and distributed systems internals by building each layer manually instead of relying on frameworks.
- Learn distributed systems by building, not just reading
- Implement a fault-tolerant, scalable file storage system
- Gain deep understanding of:
- TCP networking
- Message framing & protocols
- Data replication
- Node coordination
- Custom TCP transport layer
- Server-side
ListenandAcceptloop - Incoming connection handling
- Manual testing using Telnet
- Clean separation of transport logic
- Message framing (length-prefixed protocol)
- Wire protocol (PUT / GET / DELETE)
- Local file storage engine
- Peer discovery & membership
- Data replication & fault tolerance
Each node needs its own HTTP port, TCP port, and data directory. Start these in two separate terminals from this directory:
go run . -http :3001 -tcp :3000 -data node1-data -peers http://localhost:3002go run . -http :3002 -tcp :3003 -data node2-data -peers http://localhost:3001Upload to either node; it stores the file locally and forwards the upload to its configured peers:
curl.exe -i -X PUT --data-binary "hello from node 1" http://localhost:3001/files/greetingThe upload returns 201 Created when the local write and all configured peer writes succeed. Check both node1-data and node2-data for the stored file. This is basic HTTP upload replication; peer discovery, retrieval, retries, and conflict handling are not implemented.