Menu

Realtime communication

When an application should not wait for the next refresh

I design event communication where a user or system should receive information as soon as it occurs.

Discuss a realtime solution →

Polling is not always the answer

Current state without repeated requests to the server

With polling, the browser repeatedly asks whether something changed. A realtime model delivers an event only when it actually occurs.

What realtime can solve

The choice depends on event type, permissions and required reliability.

WebSocket communication

A two-way connection between browser and realtime layer.

Publish / subscribe

Events are delivered only to relevant topics and subscribers.

Monitoring and processing

For dashboards, notifications, CRM, reservations and background processes.

Typical scenarios

  • Live dashboards and monitoring
  • Order, reservation or CRM status
  • Browser user notifications
  • AI and worker processes that publish a result

Technical view

A custom WebSocket broker can be one implementation. Topic routing, namespaces, authorisation and observability are what matter.

PHP backend
     ↓ REST publish
Realtime broker
   ├── Browser
   ├── Worker
   └── AI service

How we work

Event, flow and access control

  1. Events What should be delivered and to whom.
  2. Channels Topics, namespaces and access rules.
  3. Operation Monitoring, error states and behaviour verification.

A use-case decision

WebSocket is not needed for everything

Polling asks for a new state at intervals and can be the simplest sufficient choice when changes are rare. A persistent WebSocket connection helps with low latency or many clients, but needs reconnects, heartbeats, authorisation and monitoring. Backpressure protects a receiver that cannot process messages fast enough.

Relevant technologies

Go WebSocket REST Wildcard topics Namespaces Authorization Monitoring Docker

Example scenario

Immediate event delivery without regular polling

The backend publishes a change; the browser or worker receives only the relevant event.

Backend
  ↓ publish
Broker
  ↓ event
Browser

Should the application react immediately?

Describe the event, users and expected behaviour.

Discuss a realtime solution →