An advanced full-stack distributed caching system simulator implementing:
- LRU (Least Recently Used) eviction
- Distributed node architecture
- Hash-based routing
- Real-time cache metrics
- Interactive React dashboard
- FastAPI backend APIs
This project simulates how distributed cache systems work internally using:
- independent cache nodes
- deterministic key routing
- node-wise eviction
- O(1) cache operations
Inspired by real-world systems like:
- Redis
- Memcached
- Distributed in-memory caching engines
- React
- Vite
- JavaScript
- Modern CSS
- Python
- FastAPI
- HashMap
- Doubly Linked List
- LRU Cache
- Hash Routing
- Distributed Partitioning
Keys are distributed across multiple cache nodes using a custom hash routing algorithm.
When a node reaches capacity:
- least recently used item gets removed
- insertion remains O(1)
- retrieval remains O(1)
Interactive frontend dashboard displaying:
- active nodes
- live cache contents
- request metrics
- hit/miss tracking
- eviction count
Supported operations:
- PUT
- GET
- DELETE
- CLEAR ALL
Frontend (React) ↓ FastAPI APIs ↓ Distributed Cache Manager ↓ Hash Router ↓ Cache Nodes ↓ LRU Cache Engine
Distributed-Cache-Simulator/
│
├── backend/
│ ├── app.py
│ ├── requirements.txt
│ └── src/
│ ├── distributed_cache.py
│ ├── cache_node.py
│ ├── lru_cache.py
│ ├── doubly_linked_list.py
│ ├── hash_router.py
│ ├── metrics.py
│ └── main.py
│
├── frontend/
│ ├── src/
│ ├── public/
│ ├── package.json
│ └── vite.config.js
│
└── README.mdEach key is routed using:
ASCII_SUM(key) % total_nodesExample:
| Key | ASCII | Node |
|---|---|---|
| A | 65 | Node 2 |
| B | 66 | Node 0 |
| C | 67 | Node 1 |
Suppose:
capacity_per_node = 2If Node 2 contains:
A
D
and new key:
G
routes to Node 2, then:
A gets evicted
because it is the least recently used item.
POST /put?key=A&value=100GET /get/ADELETE /delete/AGET /metricsGET /cache-stateDELETE /clearcd backend
pip install -r requirements.txt
uvicorn app:app --reloadBackend runs on:
http://127.0.0.1:8000
cd frontend
npm install
npm run devFrontend runs on:
http://localhost:5173
This project demonstrates understanding of:
- distributed systems
- backend engineering
- cache design
- LRU algorithms
- DSA implementation
- frontend/backend integration
- REST APIs
- system design fundamentals
Possible upgrades:
- Consistent hashing
- Redis integration
- WebSocket live updates
- Docker deployment
- Authentication
- Cloud deployment
- Node scaling simulation
- Request latency visualization
Hemanth Nelli
GitHub: https://github.com/hemanthnelli1


