Company
Date Published
Author
Zak Knill
Word count
1144
Language
English
Hacker News points
None

Summary

Realtime features in apps are made possible by sharing changes triggered by one user to other users, often requiring a connection between the client and server where the server can notify the clients of new data. This connection can be achieved through various transports such as WebSockets, sse, event-streams, or polling. Two common patterns for achieving real-time updates are "Poke/Pull" and "Push state", with the latter being more suitable for complex state changes where the client needs to know what has changed. The server in these patterns can use operations or events to push the updated state to clients, which then merge those operations into their existing state. Additionally, transports like WebSockets are often used but can pose challenges when scaling horizontally across multiple servers, highlighting the need for Pub/Sub providers that handle WebSocket infra and fan-out for better coordination.