Skip to content
Case Study

Scalable Real-Time Chat Infrastructure

Scaling a real-time messaging application to support 100k+ concurrent users with sub-100ms message delivery across mobile and web platforms.

Role
Lead Backend Engineer
Timeline
4 Months
Industry
Social / Gaming
Focus
Elixir

Context

Social / Gaming. Role: Lead Backend Engineer. Duration: 4 Months.

The problem

The previous Node.js implementation was failing to maintain WebSocket connections at scale, leading to dropped messages and significant latency for southern hemisphere users.

What I did

Re-implemented the real-time layer using Elixir and Phoenix Channels for their superior concurrency model. Utilized Redis Pub/Sub for cross-node communication in a globally distributed cluster.

Key decisions

  • /Elixir/Erlang BEAM VM for massive concurrency handling
  • /Presence tracking using Phoenix CRDTs for low-overhead user status
  • /PostgreSQL for durable message storage and history

Trade-offs accepted

  • ¬Niche expertise required for Elixir/BEAM development and ops
  • ¬Complexity in managing globally distributed state and presence
  • ¬Increased initial dev time due to migration from previous stack

Result

  • Achieved stability for 100,000+ concurrent WebSocket connections.
  • Consistent sub-100ms message delivery for 99% of global users.
  • Reduced server resources by 60% compared to the original Node.js setup.
  • Zero lost messages during node failovers and cluster rebalancing.

Technologies

ElixirPhoenix ChannelsPostgreSQLRedisWebSockets

Have a similar system challenge?

I specialize in solving high-stakes technical problems for founders. Let's build something scalable together.

Book a free 30-minute technical review 

Typically respond within 24 hours