Back to Case Studies
Case Study 02

Distributed WebSocket Presence

Real-time presence tracking across multiple server replicas with zero ghost sessions and sub-second accuracy.

<1s
Presence Accuracy
0
Ghost Sessions
120s/90s
Idle Detection
Multi
Replicas

The Problem

Needed real-time presence tracking (online/offline/idle) across multiple server replicas. Standard approaches led to ghost sessions, inconsistent status, and stale connections.

The Solution

  • Designed heartbeat-based online/offline tracking across server replicas
  • Per-connection AND per-user Redis keys for pinpoint accuracy
  • Cron-driven sweeper for zombie connection cleanup
  • Instance-aware coordination — each replica knows which connections it owns
  • Realtime idle detection: user status set to idle after 120 seconds of inactivity, resurrects after 90 seconds of activity
  • Prevents autodialer task draining from idle agents

Tech Stack

Golang Redis WebSocket Heartbeat Protocol Cron
Ready to start?

Let's build something solid.

We take on a limited number of projects to ensure every engagement gets our full engineering focus.

Start a Project