Skip to content

Backend for Real-time, Highly-Scalable Chat Room App

License

Notifications You must be signed in to change notification settings

omran95/chatroom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chatroom

GitHub tag (latest SemVer)

Backend for a real-time chat room app in a highly scalable architecture.

System architecture

image

Features

  • Real-time chatting using websockets.

  • Services are stateless and can be horizontally scaled.

    • room: creates rooms (public/protected) and handles messages.
    • subscriber: maintains Kafka subscriber topics for each room in a Redis cluster.
  • Traefik for efficient HTTP reverse proxying and load balancing

  • gRPC for low-latency and high-throughput inter-service communication.

    • with retry (Exponential backoff with jitter), timeout, and circuit breaker.
  • Graceful shutdown.

  • Observability using Prometheus + Grafana for service monitoring and OpenTelemetry + Jaeger for distributed tracing.

  • Pub/Sub using Kafka with partitioning for parallel processing.

  • Persist messages and rooms in Cassandra, A highly available and scalable NoSQL Database with tunable consistency.

  • Protect the create room API with distributed rate limiting using the Token-Bucket Algorithm with Redis.

  • Broadcasting seen, typing, joining, and leaving events to all room members.