A fully containerized distributed Content Delivery Network (CDN) simulation built using microservices architecture.
The system demonstrates intelligent traffic routing, distributed edge caching, failover handling, cache invalidation, request tracing, and real-time monitoring through an interactive frontend dashboard.
The system consists of multiple independent services communicating over a Docker network.
Acts as the central routing layer.
Responsibilities:
- Receives incoming client requests
- Selects optimal edge node
- Performs load balancing
- Detects unhealthy nodes
- Handles failover routing
Distributed cache servers that deliver content to users.
Responsibilities:
- Cache frequently requested content
- Serve cached responses
- Fetch uncached data from Origin Server
- Support LRU + TTL caching policies
- Maintain request trace metadata
Primary source of truth for all content.
Responsibilities:
- Stores original content
- Responds to cache misses
- Simulates backend content server
Dynamic service discovery system.
Responsibilities:
- Registers active edge nodes
- Tracks node health
- Provides node metadata to Traffic Manager
Handles cache invalidation across distributed nodes.
Responsibilities:
- Broadcast cache purge requests
- Remove stale cached content
- Maintain cache consistency
Collects runtime metrics from all services.
Responsibilities:
- Monitor request flow
- Track node health
- Store traffic statistics
- Provide observability APIs
Interactive frontend visualization layer.
Responsibilities:
- Visualize CDN architecture
- Display live service metrics
- Show request routing
- Monitor cache activity
- Observe failover behavior
- Multi-node distributed caching
- Reduced latency through edge delivery
- Independent cache storage per node
- Dynamic edge node selection
- Health-aware routing
- Traffic balancing
- Automatic unhealthy node detection
- Traffic rerouting to active nodes
- High availability simulation
- Distributed cache purge mechanism
- Consistent cache updates across nodes
- End-to-end request tracking
- Request path visibility across services
- Live service health monitoring
- Metrics visualization dashboard
- Request analytics
- Fully Dockerized architecture
- Multi-service orchestration using Docker Compose
- Python
- FastAPI
- REST APIs
- React / Next.js
- Docker
- Docker Compose
- HTTP APIs
- Internal service networking
distributed-cdn-system/
│
├── services/
│ ├── traffic-manager/
│ ├── edge-node-a/
│ ├── edge-node-b/
│ ├── edge-node-c/
│ ├── origin-server/
│ ├── service-registry/
│ ├── purge-service/
│ └── monitoring/
│
├── frontend/
├── docs/
├── docker-compose.yml
└── README.md
- Client sends request to Traffic Manager
- Traffic Manager selects optimal edge node
- Edge node checks local cache
- If cache hit:
- Response returned immediately
- If cache miss:
- Edge node requests data from Origin Server
- Response cached locally
- Content returned to client
- Monitoring service tracks request lifecycle
- Purge service invalidates stale cache entries when required
Install:
- Docker
- Docker Compose
- Git
Clone the repository:
git clone https://github.com/dhruv0525/distributed-cdn-system.git
cd distributed-cdn-systemStart all services:
docker-compose up --buildRun in detached mode:
docker-compose up -d --buildStop all services:
docker-compose down| Service | Port |
|---|---|
| Frontend Dashboard | 3000 |
| Traffic Manager | 8000 |
| Edge Node A | 8001 |
| Edge Node B | 8002 |
| Edge Node C | 8003 |
| Origin Server | 8004 |
| Service Registry | 8005 |
| Purge Service | 8006 |
| Monitoring Service | 8007 |
- Request served directly from edge cache
- Lower response time
- Edge node fetches content from Origin Server
- Content stored for future requests
- Traffic Manager detects unhealthy node
- Requests rerouted automatically
- Purge service invalidates distributed cached data
- Ensures consistency across nodes
- Geographic routing simulation
- Redis distributed caching
- Kubernetes deployment
- HTTPS support
- Rate limiting
- CDN analytics engine
- Distributed tracing with OpenTelemetry
- Autoscaling edge nodes
This project demonstrates practical understanding of:
- Distributed systems
- CDN architecture
- Microservices
- Load balancing
- Caching strategies
- Failover systems
- Service discovery
- Container orchestration
- Observability and monitoring
MIT License
Dhruv Thakor, Pooja Sharma, Jaimin Koriya, Tanvi Patange, Tanisha Mishra, Medha Kumar