A fault-tolerant, distributed key-value cache built with Python and Docker to demonstrate core distributed systems concepts.
- High Availability: Data is replicated across multiple nodes. If a primary node fails, a replica is automatically promoted to take its place.
- Scalability: Consistent hashing is used to intelligently distribute data, minimizing reshuffling when nodes are added or removed.
- Resilience: The master node monitors heartbeats from all worker nodes and automatically removes any that fail.
- Performance: Data is stored in-memory for fast access, with an LRU (Least Recently Used) eviction policy to manage capacity.
Prerequisites: Docker Desktop must be running.
-
Build & Run Services: From the project's root directory, run:
docker-compose up --build -d
-
Access the Web UI: Open your browser and navigate to:
http://localhost:5000 -
Stop & Clean Up: To stop all services and remove the database volume, run:
docker-compose down -v
- Set a key-value pair using the web interface.
- Get the key once to see a
database (MISS) 🟡. The system fetches from the database and populates the cache. - Get it again to see a
cache (HIT) 🟢. The data is now served instantly from memory.