Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Distributed File Server (DFS)

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.


🎯 Project Goals

  • 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

🧱 Current Status

✅ Implemented

  • Custom TCP transport layer
  • Server-side Listen and Accept loop
  • Incoming connection handling
  • Manual testing using Telnet
  • Clean separation of transport logic

🔜 In Progress / Planned

  • Message framing (length-prefixed protocol)
  • Wire protocol (PUT / GET / DELETE)
  • Local file storage engine
  • Peer discovery & membership
  • Data replication & fault tolerance

🏗️ Architecture (Early Stage)

Run Multiple Nodes Locally

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:3002
go run . -http :3002 -tcp :3003 -data node2-data -peers http://localhost:3001

Upload 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/greeting

The 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.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages