Skip to content

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.

Notifications You must be signed in to change notification settings

gstgrace/Multi-threaded-Paxos-based-Key-Value-Store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project 4 - Multi-threaded Paxos-based Key-Value Store


Project Overview

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.


Key Features

Distributed Architecture

  • 5 replicated server nodes
  • Each node implements Proposer, Acceptor, and Learner roles
  • Random acceptor failure simulation
  • Automatic acceptor recovery mechanism

Paxos Consensus Implementation

  • Complete Paxos protocol implementation:
    • Prepare phase (Phase 1)
    • Accept phase (Phase 2)
    • Learn phase (Phase 3)
  • Majority-based consensus
  • Failure handling and recovery

Key-Value Operations

  • PUT(key, value): Store data with Paxos consensus
  • GET(key): Retrieve data from any available node
  • DELETE(key): Remove data with Paxos consensus

Fault Tolerance Features

  • 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

Data Domain

  • Pre-populated with fruit inventory data
    • Keys: Fruit names
    • Values: Fruit prices

Usage - Two Execution Modes

1. Automated Testing Mode

```bash
# Clean up existing containers
docker-compose down -v

# Build fresh images
docker-compose build

# Start automated testing
docker-compose --profile automated up

2. Interactive Testing Mode

```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'

Shutdown

  • 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

Output Demo

  • Automated Mode automated-demo1.jpg automated-demo2.jpg automated-demo3.jpg automated-demo4.jpg automated-demo5.jpg automated-demo6.jpg automated-demo7.jpg automated-demo8.jpg

  • Interactive Mode interactive-demo1.jpg interactive-demo2.jpg interactive-demo3.jpg interactive-demo4.jpg

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published