A scalable, fault-tolerant distributed banking system implementing Two-Phase Commit (2PC) for cross-shard atomicity and Paxos for intra-shard replication. This project demonstrates strong consistency models (Linearizable/Read-Committed) in a sharded architecture.
The system is composed of multiple logical clusters (shards), each responsible for a subset of accounts.
- Scheduler: The central orchestrator that spawns clusters, manages mapping, and benchmarks performance.
- Clusters (Shards): Each cluster is a replicated state machine using Paxos for consensus.
- Nodes: Replicas within a cluster. They persist data and handle locking for 2PL (Two-Phase Locking).
- Sharding: Accounts are partitioned across clusters.
- Paxos: Ensures consensus within a cluster for fault tolerance.
- Two-Phase Commit (2PC): Coordinates transactions that span multiple shards (Cross-Shard) to ensure atomicity.
- Two-Phase Locking (2PL): Used during transaction execution to isolate concurrent operations.
- Python 3.8+
The entry point is src/main.py.
Run the system processing transactions from a CSV file:
python3 src/main.py run --input CSE535-F25-Project-3-Testcases.csvTo run in auto-mode (non-interactive):
python3 src/main.py run --input CSE535-F25-Project-3-Testcases.csv --autoOptions:
--clusters N: Number of logical clusters (default: 3)--nodes-per-cluster M: Nodes per cluster (default: 3)--consistency LEVEL:linearizable,read_committed, oreventual
Run performance benchmarks with generated traffic:
python3 src/main.py benchmark --tx-count 1000 --read-only 0.2 --cross-shard 0.4 --skew 0.6Benchmark Options:
--concurrency K: Number of client threads.--clusters N,--nodes-per-cluster M: System topology.
Small workload:
python3 src/main.py benchmark --tx-count 200 --read-only 0.2 --cross-shard 0.1 --skew 0.0Heavy cross-shard workload:
python3 src/main.py benchmark --tx-count 2000 --read-only 0.2 --cross-shard 0.2 --skew 0.9High-throughput read-only workload:
python3 src/main.py benchmark --tx-count 30000 --read-only 0.0 --cross-shard 0.0 --skew 0.0