Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

Tiny Discord

Overview

This project is a simplified system design implementation of a real-time chat system inspired by Discord. It focuses on low-latency messaging, persistent chat history, and real-time presence across channels and servers.


Problem Statement

Real-time communication platforms must deliver messages instantly while supporting large groups of users, multiple channels, and persistent message history. This project explores how to design a simplified version of a chat system that handles message delivery, user presence, and channel-based communication at scale.


Learning Objectives

  • Understand real-time messaging system design
  • Learn how WebSocket-style communication works conceptually
  • Explore low-latency message delivery strategies
  • Understand channel-based architecture and fanout models
  • Learn how presence and user status systems work
  • Explore tradeoffs between consistency and real-time performance
  • Build intuition for scalable chat systems

Core Features

Messaging System

  • Send and receive messages in real time
  • Channel-based communication
  • Message persistence and retrieval

Channel & Server Model

  • Servers (guilds) containing multiple channels
  • Channel-based message segregation
  • Basic membership model

Real-Time Communication

  • Live message delivery to connected users
  • Presence updates (online/offline/idle conceptually)
  • Basic event broadcasting system

Message History

  • Persistent chat logs
  • Paginated message retrieval
  • Ordered message streams

Architecture (Conceptual)

Client Layer

  • Connects to server via real-time connection (WebSocket concept)
  • Sends and receives messages
  • Maintains local message state

Messaging Server

  • Handles real-time connections
  • Routes messages to correct channels
  • Broadcasts events to connected clients

Data Layer

  • Stores messages per channel
  • Stores user and server metadata
  • Supports efficient history retrieval

Engineering Considerations

  • Low-latency message delivery at scale
  • Handling large numbers of concurrent connections
  • Message ordering guarantees
  • Fanout strategy for group channels
  • Presence consistency and update frequency
  • Tradeoffs between memory usage and persistence

Integration Ideas

  • Message Queue (event distribution backbone)
  • Rate Limiter (spam and abuse prevention)
  • Distributed Cache (hot channel/message optimization)
  • Load Testing (connection scalability testing)
  • Monitoring (latency and delivery metrics)

Status

🟡 Planned

About

Real-time chat system focusing on messaging, channels, and low-latency communication.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors