No description
  • C++ 99.8%
  • Makefile 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-07-30 20:35:59 +08:00
.github Create FUNDING.yml 2025-07-30 20:35:59 +08:00
dataserver.cpp add fetch function 2018-06-18 13:55:57 +08:00
dataserver.h add fetch function 2018-06-18 13:55:57 +08:00
filetree.cpp fix(filetree): fix command ls problem. 2025-07-12 10:12:41 +08:00
filetree.h fix(filetree): fix command ls problem. 2025-07-12 10:12:41 +08:00
LICENSE.md Create LICENSE.md 2022-09-05 20:53:27 +08:00
main.cpp init commit 2018-06-18 12:46:42 +08:00
makefile init commit 2018-06-18 12:46:42 +08:00
nameserver.cpp fix(filetree): Put to identical path successfully multiple times. 2025-07-12 10:12:41 +08:00
nameserver.h init commit 2018-06-18 12:46:42 +08:00
README.md add fetch function 2018-06-18 13:55:57 +08:00
util.cpp init commit 2018-06-18 12:46:42 +08:00
util.h init commit 2018-06-18 12:46:42 +08:00

miniDFS

Simple version of Distributed File System

Design a Mini Distributed File System (Mini-DFS), which contains

  • A client
  • A name server
  • Four data servers img

Mini-DFS is running through a process. In this process, the name server and data servers are different threads

Basic functions of Mini-DFS

  • Read/write a file
  • Upload a file: upload success and return the ID of the file
  • Read the location of a file based on the file ID and the offset

File striping

  • Slicing a file into several chunks
  • Each chunk is 2MB
  • Uniform distribution of these chunks among four data servers

Replication

  • Each chunk has three replications
  • Replicas are distributed in different data servers

Name Server

  • List the relationships between file and chunks
  • List the relationships between replicas and data servers
  • Data server management

Data Server

  • Read/Write a local chunk
  • Write a chunk via a local directory path

Client

  • Provide read/write interfaces of a file

Mini-DFS can show

  • Read a file (more than 7MB)
  • Via input the file and directory
  • Write a file (more than 3MB)
  • Each data server should contain appropriate number of chunks
  • Using MD5 checksum for a chunk in different data servers, the results should be the same
  • Check a file in (or not in) Mini-DFS via inputting a given directory
  • By inputting a file and a random offset, output the content

compile

make

run

./miniDFS
put source_file_path dest_file_path
ls
locate FileID Offset
fetch FileID Offset dest_file_path
...
read source_file_path dest_file_path
...