All work

Real-time broadcast architecture for a K-12 education platform

Client K-12 education client · Contract
Role Lead Application Developer · Contract
Period Jan 2026
  • Laravel
  • React
  • Reverb
  • PostgreSQL

I helped build the real-time broadcast layer that keeps a multi-role K-12 education platform current for connected users without polling.

Outcome

I helped build the real-time broadcast layer that keeps a multi-role K-12 education platform current for connected users without polling.

Context

This was contract work on a K-12 education platform built with Laravel 13, PostgreSQL, React 19, Reverb, and Horizon. I built the broadcast layer alongside the client team, whose product workflows serve multiple staff roles on shared operational screens.

Problem

The platform supports time-sensitive coordination across multiple roles. When one user changes operational state, other authorized users need to see that change quickly and consistently. Polling would add database load and still leave stale windows. The core question was how to push updates to the right screens, and only the right screens, in real time.

Constraints

  • Multiple roles see different slices of the same operational data, so changes cannot be broadcast to everyone.
  • The stack is modern and opinionated: Laravel 13 with Reverb and Horizon on the back end, React 19 with TypeScript, TanStack Query, and Zustand on the front.
  • K-12 data is sensitive, so channel authorization and payload minimization are correctness requirements, not niceties.
  • Product internals stay high-level here; the contribution level is shareable, the rest is relative.

Decisions and trade-offs

WebSockets over polling. Polling at the frequency this workflow needs would hammer PostgreSQL and still lag. Rejected. The Laravel + React real-time broadcast path runs over a self-hosted Reverb WebSocket server, so the server pushes only when state actually changes.

Per-action events over a firehose. The easy design is one "something changed, refetch" signal. Rejected: it wakes every client on every change and gives the UI nothing useful about what to update. Instead each mutating action emits its own named event onto private, role-scoped channels, and each event computes exactly which recipients should listen. Events carry ids and enums, not full records, so a channel never overshares. Broadcasts dispatch only after the database commits and run on a dedicated queue lane with bounded retries, so a client never sees a change that later rolled back.

Server-confirmed UI over optimistic writes. Optimistic updates feel instant but invite divergence when a mutation is rejected by a business rule. Rejected for the mutating path. The React layer treats the broadcast as the source of truth: an action fires, and the authoritative update arrives over the socket and invalidates the relevant TanStack Query cache. Correctness wins over the last few milliseconds of perceived latency.

What breaks first at 10x load. Not PostgreSQL, and not the React clients. The first pressure point is the broadcast fan-out path: the queue lane feeding Reverb and the per-event recipient computation. At much higher concurrent write volume that path saturates before the datastore does, so the headroom plan is horizontal Reverb capacity plus precomputed recipient routing, not a bigger database.

Implementation

I added named, post-commit Laravel events for mutating actions, delivered through dedicated queue capacity to private role- and user-scoped Reverb channels. The client team's React application consumes minimal event payloads and invalidates the relevant TanStack Query cache only after the server confirms the change.

Results

The shared operational surface stays live across roles without polling, and the design has a named, honest scale limit rather than a hidden one. In a sustained push through 2026 I became one of the top contributors to the platform, and the broadcast architecture is the piece that makes a multi-role real-time education platform feel like one shared surface.

Takeaways

Real-time systems need explicit recipient boundaries and server-confirmed state, not a broad “something changed” signal. Naming the fan-out bottleneck upfront turns the scale plan into an engineering decision rather than an incident response.

Back to resume