This project demonstrates a totally ordered Remote Method Invocation (RMI) system using the Raft consensus algorithm. The goal is to achieve reliable and consistent communication between distributed nodes.
- Totally Ordered Messaging: Messages are delivered in the same order across all nodes.
- Raft Consensus Algorithm: Ensures consistency and fault tolerance.
- Java RMI: Utilizes Java’s built-in RMI framework for communication.
- File System Operations: Allows users to upload, delete, download, and search files.
To get started with this project, follow these steps:
- Clone this repository:
git clone https://github.com/YasoKarim/Totally-Ordered-RMI.git
- Navigate to the project directory:
cd Totally-Ordered-RMI
- Run multiple Parallels:
- Click Run ➡️ Edit Configurations….
- Select the configuration for the file that requires multiple instances.
- Check the Allow parallel run option.
- Click Apply.
- Specify the Input:
- You choose a number to do one of the operations(Delete, Upload, Download and Search) Each node maintains a local logical clock value.
- When a node wants to send a request, it updates its logical clock and multicasts the request (timestamped with its logical clock value) to all other nodes.
- Upon receiving a request, the recipient puts it in a queue ordered by requests’ timestamp (a tie breaker will be needed for requests with the same timestamp e.g. requestId), then the recipient multicasts an ACK to other nodes (ACKs are not queued).
- A request is executed only when it has been ACKed by all nodes.
- For the Upload and Delete requests, all nodes should execute the requests.
- For the Download and Search requests only one node (Leader) should execute the request. (A leader is selected randomly).