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
- Client
- API
- Single backend holding the WebSocket connection
- Client
- API Gateway
- ECS instances #1…#N
- Redis realtime layer
- 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.
More case studies
- Scaling a high-traffic microservices backend on AWS
- Making cache synchronisation resilient with SQS, retries and a DLQ
- Removing a webhook race condition with database-level idempotency
- Protecting SMS OTP endpoints from automated abuse
- Leading delivery decisions under deadline pressure