Skip to content

Instantly share code, notes, and snippets.

@anushshukla
Created August 21, 2023 08:00
Show Gist options
  • Save anushshukla/0ef6608227313bbce03e45d7a578bdc2 to your computer and use it in GitHub Desktop.
Save anushshukla/0ef6608227313bbce03e45d7a578bdc2 to your computer and use it in GitHub Desktop.
Scalable chat application

Problem statement

Develop a simple chat app fulfiling below requirements

  • group and one-on-one chats.
  • same socket instance reconnection after disconnection
  • switch between long polling and sockets, incase sockets are not working
  • stream back lost messages when user reconnects
  • scalable

Solution

Tech stack

Technology Open source Purpose
Socket.io Yes Building the RTA (real time application).
Node.js Yes Quicky developing a scalable backend service to easily implement socket.io.
PostgreSQL Yes Data source for relational data storage to perform better during heavy write ops.
Cassandra Yes Highly scalable data source for misc. chat requirements like chat history.
React.js Yes Building SPA (single page application) for better UX

System Design

Detailed Design

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment