Farhan.

Firebase Group Chat Platform

Shipped

500 concurrent users is easy. Knowing what each message costs isn't.

Real-time group chat on Firebase, handling 500+ concurrent users at 40% lower read costs through architectural optimization, not brute-force scaling.

FlutterFirebaseCloud FirestoreRealtime Database

What it does

Real-time group chat — messages, presence, and room membership synced live across every connected client on Firebase.

Architecture

The naive model treats every message as 'written once, read by everyone listening' — simple until membership and message frequency grow, and every read starts adding up. I restructured how rooms fan out reads to cut that cost by 40% at the current scale, without changing what the client experiences.

Implementation

Beyond the shipped version, I've worked through the read-amplification math for much larger rooms by hand — what changes when a room has thousands of members instead of dozens, where per-user rate limits start to matter, and where the small-room model stops holding. That's architecture exploration, not a claim about what this deployment currently handles.

Trade-offs

Optimizing read costs meant giving up some of the simplicity of the naive fanout model. Worth it at this scale — the interesting open question is where that trade stops being worth it.