Skip to content

BeeSocial is a Java-based distributed system that enables decentralized sharing and management of .jpg image files across networked nodes.

License

Notifications You must be signed in to change notification settings

mradovic38/bee-social

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐝 BeeSocial - Distributed Image Sharing System

BeeSocial is a Java-based distributed system that enables decentralized sharing and management of .jpg image files across networked nodes. Designed to simulate a minimal social platform, BeeSocial includes key distributed systems principles such as self-organization, fault tolerance, and eventual consistency, while supporting user interactions via a simple command-line interface.

📌 Features

  • Distributed File System

    • Add and distribute .jpg image files across nodes
    • Browse and fetch files from other nodes
    • Remove files from the local node
  • Node Interactions

    • Follow/unfollow nodes
    • Visibility control (public/private profiles)
  • Topology-aware Communication

    • Peer-to-peer Chord architecture
    • Logarithmic message routing for scalability
  • Fault Tolerance

    • Dual-phase failure detection: weak and strong failure boundaries
    • Buddy system for failover and data recovery
  • Bootstrap-less Self-Organization

    • Bootstrap server only introduces a node into the system, with no further control
    • Decentralized, resilient structure with dynamic join/leave capability
  • Fair Distributed Mutual Exclusion

    • Fair mutex implementation using Suzuki–Kasami algorithm

🧪 Commands (CLI Interface)

Command Description
follow [ip:port] Sends a follow request to the specified node
pending Lists incoming follow requests
accept [ip:port] Accepts a follow request
upload [relative_path] Uploads a file to the network
visibility [public/private] Sets the visibility of your files
list_files [ip:port] Lists files of another node (if allowed)
remove_file [filename] Removes file from the local node
quit Gracefully exits the node from the system
stop Violently shuts down the node from the system

⚙️ Configuration

See file chord/servent_list.properties

  • servent_count: Number of servents in the system
  • chord_size: Capacity of the Chord architecture
  • root: Local working directory for storing files
  • cache: Local working directory for saving files gathered using commands
  • servent{x}.port: Listening port for the node {x}
  • bs,port: Listening port for the bootstrap node
  • weak_limit: Time before suspecting a node (ms)
  • strong_limit: Time before removing a node (ms)

Note: Config files must be consistent across all nodes.

📡 System Architecture

BeeSocial supports the Chord architecture:

  • ✅ Fully decentralized
  • ✅ Logarithmic routing
  • ✅ Fault-resilient, dynamic restructuring

🛠️ Fault Detection

  • Phase 1: Weak Suspect

    • Node unresponsive beyond the weak threshold
    • Cross-verification by another stable node (buddy node)
  • Phase 2: Strong Failure

    • Node unresponsive beyond strong threshold
    • Node removed from the system
    • Buddy nodes take over responsibilities

🗃️ Data Redundancy

Each file is stored on the originating node, and at least one replica exists in the system to support fault recovery.

🔒 Distributed Mutual Exclusion

Supports a fair mutex algorithm to control access to shared resources:

  • Implemented using Suzuki–Kasami token-based algorithm

🧳 Project Structure

bee-social/
├── src/
│   ├── app/                       # System management
│   ├── cli/                       # Command-line interface
│   ├── fault_tolerance/           # Fault tolerance logic
│   ├──mutex/                      # Mutex implementation
│   └── servent/                   # Node logic
├── chord/
│   ├── error/                     # Error debug log for each node
│   ├── input/                     # Input commands for each node
│   ├── output/                    # Output debug log for each node
│   └── servent_list.properties    # System configuration
├── cache/                         # Directory for saving files gathered using commands
├── root/                          # Directory for storing files
├── README.md
└── ...

🧪 Running the System

  1. Compile the project:

    javac -d out src/**/*.java
  2. Start MultipleServentStarter:

    java -cp out app.MultipleServentStarter

📖 Resources

About

BeeSocial is a Java-based distributed system that enables decentralized sharing and management of .jpg image files across networked nodes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages