All case studies
Case study

A realtime social platform that scales horizontally

Go, WebSocket and Redis realtime layer letting ECS instances scale out while users on different servers still get each other's events; PostgreSQL + PostGIS.

Context
Realtime social / matching app (client under NDA)
Role
Tech Lead / Backend
Key point
WebSockets across N instances
  • Go
  • WebSocket
  • Redis
  • PostgreSQL
  • PostGIS
  • AWS ECS
  • API Gateway

The problem

Users needed realtime interactions, including mood-based matching and location-aware features.

With several backend instances, a user connected to server A might need an event produced on server B, so WebSockets could not depend on a single server.

Architecture: before → after

Before
  1. Client
  2. API
  3. Single backend holding the WebSocket connection
After
  1. Client
  2. API Gateway
  3. ECS instances #1…#N
  4. Redis realtime layer
  5. Event reaches the user's instance

What I did

  • Ran the Go backend as multiple services on ECS behind API Gateway, with autoscaling.
  • Used Redis as the shared realtime layer, so any instance can deliver events to users connected elsewhere.
  • Stored location data in PostgreSQL with PostGIS for the location-related features.

Outcome

  • Application instances can scale horizontally without tying realtime delivery to one server.
  • Location and matching features backed by PostGIS queries in the main database.