What is FastDFS?

FastDFS is a lightweight, high-performance open source distributed file system developed by Mr. Yu Qing of Taobao. Developed in pure C language, it provides the following functions: • File storage • File synchronization • File access (upload and download) • Access load balancing • Online capacity expansion Suitable for applications or systems with large storage requirements. Similar distributed file systems are Google’s GFS, HDFS (Hadoop) (used for big data), TFS (Taobao), etc

Architecture diagram



FastDFS has two main roles:Tracker ServerStorage Server.

• Tracker Server: a tracking Server that schedules the communication between the storage node and the client, balances the load on the access, and records the running status of the storage node. It is the hub between the client and the storage node.

• Storage Server: Each storage server will start a separate thread to actively report its status information, including disk usage, to each Tracker server in the Tracker cluster. File synchronization and file upload and download times at the same level.

• Group: indicates a file Group that contains multiple Storage servers. After you upload a file to one machine in the same group, FastDFS synchronizes the file to all other machines in the same group for backup. Different groups of servers store different data independently of each other and do not communicate with each other.

• Tracker Cluster: A Cluster of tracking servers, consisting of a group of Tracker servers.

• Storage Cluster: a Storage Cluster consisting of multiple groups.

Upload and download processes

  1. The Client uses the Tracker server to search for available Storage servers.
  2. The Tracker Server returns the IP address and port number of an available Storage server to the Client.
  3. The Client connects to a Storage server and uploads files using the IP address and port returned by the Tracker server.
  4. When the upload is complete, the Storage server returns a file ID to the Client.

  5. The Client uses the Tracker server to find the Storage server where the file is to be downloaded.
  6. The Tracker server returns to the Client the IP address and port number of a Storage server that contains the specified file.
  7. The Client directly establishes a connection with a Storage server using the IP address and port returned by the Tracker server and specifies the file to be downloaded.
  8. The file was downloaded successfully. Procedure