This project implements a distributed key-value store system using the Paxos consensus algorithm across five replicated servers. The system ensures data consistency and fault tolerance through Paxos consensus, featuring simulated random acceptor failures and recoveries.
- 5 replicated server nodes
- Each node implements Proposer, Acceptor, and Learner roles
- Random acceptor failure simulation
- Automatic acceptor recovery mechanism
- Complete Paxos protocol implementation:
- Prepare phase (Phase 1)
- Accept phase (Phase 2)
- Learn phase (Phase 3)
- Majority-based consensus
- Failure handling and recovery
PUT(key, value)
: Store data with Paxos consensusGET(key)
: Retrieve data from any available nodeDELETE(key)
: Remove data with Paxos consensus
- Random acceptor failures at 2-4 second intervals
- Automatic acceptor recovery after 2-4 seconds
- System continues functioning with majority of nodes available
- Consistent state maintenance across recoveries
- Pre-populated with fruit inventory data
- Keys: Fruit names
- Values: Fruit prices
```bash
# Clean up existing containers
docker-compose down -v
# Build fresh images
docker-compose build
# Start automated testing
docker-compose --profile automated up
```bash
# Clean up existing containers
docker-compose down -v
# Build fresh images
docker-compose build
# Start in interactive mode
docker-compose --profile interactive up
# In a new terminal, attach to interact:
docker attach paxos-interactive-client
# then enter command in the format below:
Enter command (PUT/GET/DELETE:key:value[only with PUT] or 'exit'
- Automated Mode: Use Ctrl+C (Windows/Linux) or Cmd+C (Mac)
- Interactive Mode: Type exit in the client terminal
- Run docker-compose down to clean up containers