https://github.com/dj1095/two-phase-distributed-commit
An implementation of the Two-Phase Commit protocol for distributed systems, ensuring atomicity in transactions. Robust, fault-tolerant, and scalable.
https://github.com/dj1095/two-phase-distributed-commit
atomicity client-server distributed-systems fault-tolerance java8 multithreading rpc-framework scalability two-phase-commit
Last synced: 12 months ago
JSON representation
An implementation of the Two-Phase Commit protocol for distributed systems, ensuring atomicity in transactions. Robust, fault-tolerant, and scalable.
- Host: GitHub
- URL: https://github.com/dj1095/two-phase-distributed-commit
- Owner: dj1095
- License: apache-2.0
- Created: 2022-10-20T03:26:37.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-02-29T14:58:35.000Z (almost 2 years ago)
- Last Synced: 2025-01-02T03:14:40.558Z (about 1 year ago)
- Topics: atomicity, client-server, distributed-systems, fault-tolerance, java8, multithreading, rpc-framework, scalability, two-phase-commit
- Language: Java
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🌐 Two-Phase Distributed Commit
## Overview
The Two-Phase Distributed Commit project is an implementation of the Two-Phase Commit protocol for distributed systems. This protocol ensures atomicity in distributed transactions, providing a reliable and fault-tolerant solution for coordinating transactions across multiple nodes.
## Features
- **Two-Phase Commit Protocol:** Implements the classic Two-Phase Commit protocol to ensure consistent and atomic distributed transactions.
- **Fault Tolerance:** Robust handling of failures and recoverability to maintain system integrity even in the presence of node failures.
- **Scalability:** Can be added more nodes easily to replicate a scenario with a lot of nodes
## Getting Started
- Need JRE to run the project
```bash
# Example commands to get started
git clone https://github.com/dj1095/two-phase-distributed-commit.git
cd two-phase-distributed-commit
```
## Handled Scenarios
### Node Failure
- In the event of a node failure during the transaction, the Two-Phase Distributed Commit project gracefully handles the situation:
- If a participant node fails during the prepare phase, the coordinator detects the failure and aborts the transaction.
- If a participant node fails during the commit phase, the coordinator detects the failure and initiates a rollback to maintain consistency.
### Transaction Coordinator Failure
- In the rare scenario where the transaction coordinator fails:
- The system is designed to recover from coordinator failures and resume normal operation.
- Participants receive a notification of the failure and take appropriate measures, such as rolling back the transaction.