Every client wants real-time features. Live dashboards, instant notifications, collaborative editing. The request is framed as simple. The implementation ranges from trivial to extraordinarily complex. Picking the wrong approach is one of the most expensive mistakes we see.
We use three patterns, chosen by two factors: concurrent users viewing the same data, and how critical the update timing is.
Pattern one: polling with smart intervals. The client makes periodic GET requests. If nothing changed, the server returns 304 with no body. We use this when fewer than fifty users view the same data and five to fifteen second delays are acceptable. Dashboards, order status pages, inventory displays. Implementation is ten lines using TanStack Query with refetchInterval. No persistent connections, no special infrastructure, works through any proxy or CDN.
Pattern two: server-sent events (SSE). The server pushes updates over a kept-open HTTP connection. Client does not push back. Perfect for notifications, activity feeds, and progress indicators. We use Supabase Realtime, which listens to PostgreSQL LISTEN/NOTIFY and broadcasts to clients. About five lines of client code. Without Supabase, a Node.js SSE endpoint subscribing to Redis pub/sub -- about sixty lines.
Pattern three: WebSockets for bidirectional communication. Persistent full-duplex connections for collaborative editing, real-time chat, and live cursor positions. Significantly more complex: connection management, room logic, message ordering, backpressure handling. We use Socket.io for most cases and Yjs (a CRDT library) for collaborative editing, which handles concurrent edit merging without months of custom engineering.
Infrastructure requirements scale with patterns. Polling needs nothing extra. SSE is modest. WebSockets need sticky sessions, shared pub/sub via Redis for horizontal scaling, and careful memory management at scale.
Our estimate: 60 percent of "real-time" requests are served by polling, 25 percent by SSE, and only 15 percent genuinely need WebSockets. Starting with the simplest adequate pattern saves significant engineering time and operational complexity.
About the Author
Fordel Studios
AI-native app development for startups and growing teams. 14+ years of experience shipping production software.
Most analytics setups track everything and understand nothing. We cut our client analytics to twelve key events and got better insights. Here is the framework.
Your startup does not need Airflow, dbt, Snowflake, or a dedicated data engineering team. Here is the data pipeline architecture that serves 90 percent of early-stage needs with tools you already have.
We love talking shop. If this article resonated, let's connect.
Start a ConversationTell us about your project. We'll give you honest feedback on scope, timeline, and whether we're the right fit.
Start a Conversation