Get the latest tech news

Patterns for Building Realtime Features


Realtime features make apps feel modern, collaborative, and up-to-date. The features predominantly require sharing changes triggered by one user to other users, as the changes are happening. This typically means your server needs to send data to some set of clients, where those clients don’t know they are missing the data. These patterns rely on a connection between the client and the server, where the server can notify the client of some data.

Pushing ops (operations) makes it easier for clients to work out what has changed, and reduces the size of the data that needs to be transferred. The purists will argue this is a better data representation, but really it causes more disparate clients to need to implement the same “business logic” by understanding that the event means the completed field should be changed to true. There are a bunch of different transports that you can use to keep the server and client connected; websockets, sse, event-streams, comet, polling (long or short).

Get the Android app

Or read this on Hacker News

Read more on:

Photo of patterns

patterns

Related news:

News photo

Jujutsu VCS: Introduction and patterns

News photo

Patterns for Personal Web Sites (2003)

News photo

The color and color-patterns of moths and butterflies (1897)