Skip to content

yashdotdev13/Distributed-streaming-platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

212 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Distributed Streaming Platform

A production-grade distributed microservices streaming platform built using Spring Boot, Kafka, and Kubernetes.

This project demonstrates how modern backend systems are designed using:

  • ๐Ÿงฉ Microservices Architecture
  • โšก Event-Driven Communication (Kafka)
  • ๐Ÿ” Service Discovery (Eureka)
  • ๐ŸŒ API Gateway Routing
  • โ˜ธ๏ธ Kubernetes Deployment
  • ๐Ÿณ Containerization with Docker

๐ŸŽฏ What This Project Solves

This system simulates a real-world video streaming backend where:

  • Users upload content
  • Content is processed asynchronously
  • Streaming is handled efficiently
  • Analytics are generated from events

๐Ÿ’ก Why This Project Matters

This project is designed to reflect real industry-level system design, covering:

  • Scalable microservices
  • Distributed communication
  • Fault tolerance challenges
  • Kubernetes orchestration

๐Ÿ—๏ธ Architecture Overview

The system follows a microservices-based distributed architecture deployed on Kubernetes.

It is designed to handle high-throughput streaming workloads using asynchronous event-driven communication.


๐Ÿ“Š High-Level System Architecture

system_architecture.png


๐Ÿ” Microservices Architecture

microservices-architectur.jpg


๐Ÿง  Core Architectural Concepts

1. API Gateway Pattern

All incoming requests are routed through a centralized API Gateway, which:

  • Handles routing
  • Provides a single entry point
  • Simplifies client interaction

2. Service Discovery (Eureka)

Each microservice registers with the Discovery Server, enabling:

  • Dynamic service lookup
  • Loose coupling between services
  • Resilience in distributed communication

3. Event-Driven Architecture (Kafka)

The system uses Apache Kafka for asynchronous communication:

  • Content ingestion โ†’ produces events
  • Streaming & analytics โ†’ consume events
  • Decouples services for scalability

4. Database per Service Pattern

Each service manages its own data:

  • MySQL โ†’ persistent storage
  • Redis โ†’ caching layer
  • MinIO โ†’ object storage (videos/files)

5. Kubernetes Orchestration

All components are deployed using Kubernetes:

  • Deployments โ†’ stateless services
  • StatefulSets โ†’ Kafka
  • Services โ†’ internal networking
  • Ingress โ†’ external routing

๐Ÿ”„ Request Flow (Simplified)

  1. User hits streaming.local via Ingress
  2. Request goes to API Gateway
  3. Routed to respective microservice
  4. Services communicate via:
    • REST (synchronous)
    • Kafka (asynchronous)
  5. Data stored and processed across services

๐Ÿ“ Project Structure

distributed-streaming-platform/
โ”‚
โ”œโ”€โ”€ api-gateway/              # API Gateway (Routing layer)
โ”œโ”€โ”€ discovery-server/         # Eureka Service Registry
โ”œโ”€โ”€ auth-service/             # Authentication & JWT
โ”œโ”€โ”€ user-service/             # User management
โ”œโ”€โ”€ content-service/          # Content metadata
โ”œโ”€โ”€ content-ingestion-service/# Content upload pipeline
โ”œโ”€โ”€ streaming-service/        # Streaming logic
โ”œโ”€โ”€ video-processing-service/ # Video processing pipeline
โ”œโ”€โ”€ analytic-service/         # Analytics & event processing
โ”‚
โ”œโ”€โ”€ common-lib/               # Shared DTOs & utilities
โ”œโ”€โ”€ kafka-kraft/              # Kafka setup (KRaft mode)
โ”‚
โ”œโ”€โ”€ k8s/
โ”‚   โ”œโ”€โ”€ infrastructure/       # Kafka, MySQL, Redis, MinIO
โ”‚   โ”œโ”€โ”€ services/             # Microservice deployments
โ”‚   โ”œโ”€โ”€ ingress/              # Ingress configuration
โ”‚   โ””โ”€โ”€ namespace/            # Namespace setup
โ”‚
โ”œโ”€โ”€ docker-compose.yaml       # Local development setup
โ”œโ”€โ”€ init-db.sql               # Database initialization
โ”œโ”€โ”€ images.txt                # List of Docker images
โ”œโ”€โ”€ prometheus.yml           # Monitoring config
โ”œโ”€โ”€ pom.xml                  # Parent Maven configuration
โ””โ”€โ”€ README.md

๐Ÿง  Structure Highlights

๐Ÿ”น Modular Microservices

Each service is independently developed and deployed, enabling:

  • Independent scaling
  • Fault isolation
  • Faster development cycles

๐Ÿ”น Shared Library (common-lib)

Contains:

  • DTOs
  • Event classes
  • Common utilities

๐Ÿ‘‰ Ensures consistency across services


๐Ÿ”น Infrastructure as Code (Kubernetes)

All infrastructure is defined declaratively under k8s/:

  • Infrastructure layer (Kafka, DBs)
  • Service deployments
  • Networking (Ingress)

๐Ÿ”น Hybrid Setup

  • Docker Compose โ†’ Local development
  • Kubernetes โ†’ Production-like deployment

โš™๏ธ Tech Stack

๐Ÿง  Backend

  • Java (Spring Boot) โ€” Core microservices framework
  • Spring Cloud โ€” Service discovery & gateway
  • Spring Security + JWT โ€” Authentication & authorization

โšก Messaging & Streaming

  • Apache Kafka โ€” Event-driven communication
  • Kafka KRaft Mode โ€” Zookeeper-less setup

๐Ÿ—„๏ธ Databases & Storage

  • MySQL โ€” Relational database
  • Redis โ€” Caching layer
  • MinIO โ€” Object storage (video/files)

โ˜ธ๏ธ DevOps & Infrastructure

  • Docker โ€” Containerization
  • Kubernetes (Minikube) โ€” Container orchestration
  • Ingress Controller (NGINX) โ€” External routing

๐Ÿ“Š Monitoring & Observability

  • Prometheus โ€” Metrics collection

๐Ÿ› ๏ธ Build & Tools

  • Maven โ€” Build tool
  • Docker Compose โ€” Local setup

๐Ÿงฉ Microservices Overview

Service Responsibility
API Gateway Routes incoming requests
Discovery Server Service registry (Eureka)
Auth Service Authentication & JWT
User Service User management
Content Service Content metadata
Content Ingestion Service Upload pipeline
Streaming Service Streaming logic
Video Processing Service Video processing
Analytics Service Event analytics

๐Ÿ“ธ Screenshots

๐ŸŸข Kubernetes Pods (All Services Running)

!3.jpg


๐Ÿ”Œ Services (Internal Networking)

!5.jpg


๐Ÿš€ Key Highlights

  • Built a distributed microservices system from scratch
  • Implemented event-driven architecture using Kafka
  • Deployed complete system on Kubernetes (Minikube)
  • Integrated API Gateway + Service Discovery (Eureka)
  • Designed for scalability, modularity, and fault isolation

๐Ÿ”ฎ Future Improvements

  • Add CI/CD pipeline (GitHub Actions)
  • Enable autoscaling (HPA)

๐Ÿง‘โ€๐Ÿ’ป Author

Yash chauhan
Backend Engineer | Distributed Systems Enthusiast


โญ Support

If you found this project useful, consider giving it a โญ on GitHub.

About

High-throughput event streaming platform built with Kafka, microservices & real-time processing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors