7 min readUpdated Dec 9, 2025

User presence at scale

User presence at scale
Jo StichburyJo Stichbury

At its most simple, user presence represents a user’s online or offline status and is typically used to show whether a user is available, for example, on a chat system. Presence is also widely used to create a sense of shared activity or immediacy in live experiences. Here are some other examples of where it’s used:

  • For audience engagement: members on a Twitch livestream see who is online to share the experience, to send each other emoji reactions or gif memes.
  • If a gamer spots that a friend is online on Discord, they can message them to join a particular game lobby.
  • In medical apps, a doctor can be notified when a patient has entered the online waiting room so that they can prepare for the appointment.
  • In education software, a teacher may be notified that a student has entered the virtual classroom so they can interact with them individually before a class begins.
  • In online collaboration tools such as Google docs, as someone works in a document, they can see who else has opened the file to work on it.

Presence is a key feature of live apps and services and a primary element of the user experience in audience engagement. It is a great way to build a sense of immediacy between participants; knowing who else is online builds a sense of inclusion and interaction.

Besides indicating availability, presence can display the user’s status. For example, if the user’s account has been inactive for a certain number of minutes, they may be set as “Away”. Alternatively, the user can customize a status message or apply one from a set and use emojis to indicate what they are doing. Within an organization, the use of a specific set of status updates builds a common lexicon amongst participants and gives a sense of community.

Some systems allow status information to include details such as the user’s current location, or whether they are currently typing a message, and offer alerts when the presence information of a user changes.

How to monitor user presence with Ably

Ably powers synchronized digital experiences like virtual live events and synchronized collaboration and offers feature-complete messaging, including features like presence. Ably is an event-driven system that uses a scalable and resilient messaging pattern called pub/sub. Clients attach to channels to subscribe to messages, and every message published to a unique channel is broadcast by Ably to all the channel’s subscribers.

Ably’s presence APIs enable pub/sub channel clients to be aware of others currently “present” on the channel. Live presence information is handled with an event or message when a user joins the presence set and another when they leave.

Clients can attach to a channel to receive messages published on it or to publish messages. They do not necessarily need to mark themselves as present but if they want to be seen by other users, they may explicitly call enter to join the presence set, which emits an enter event to notify others of their presence.

They can retrieve the current members of the presence set for the channel by calling get and can call subscribe to receive events as the membership of the presence set changes.

Each client on a channel has a self-assigned client identifier and a system-assigned connection identifier, along with an optional payload that can describe their status or attributes. The optional payload can be a string, JSON object, JSON array, or binary data.

Ably offers the following presence events:

enter A new member has entered the presence set
leave A member has left, either explicitly or after disconnection and timeout
update A member has updated their data, for example a typing indicator
present Emitted for each existing member when you begin subscribing

Presence event messages include the client ID, connection ID, and an action that tells you about the event: enter, update, or leave.

Best practice
Although many developers try to maintain their own presence list by applying enter, update, and leave events locally, this often leads to inconsistencies. The recommended practice is to call presence.get() whenever any presence event arrives and rebuild your presence list from that authoritative set. This avoids errors involving multi-device connections or synthetic leave events.

What is the difference between presence and occupancy?

Ably Presence provides information about the activity of clients who have explicitly entered into the presence set of a channel. Presence events are emitted by any client who has entered the presence set as a member (when they enter, leave, or update their member data).

Not all clients of a channel will enter the presence set, so Ably Occupancy provides metrics about all clients attached to a channel. This includes a count of the number attached, the number of publishers and subscribers, the number of presence set members, and the number of presence publishers and subscribers.

The challenge of user presence at scale

When the presence set of a channel has just a few members, the number of presence events is manageable, but consider the following example as the numbers scale.

  • A user enters the presence set of a channel in a live event system and subscribes to presence notifications. They receive a presence event. Total number of presence events: 1
  • A second user enters the presence set of the same channel and subscribes to presence notifications. Both users receive a presence event. Total number of presence events: 3
  • A third user enters and subscribes. All three users receive a presence event. Total number of presence events: 6
  • This pattern continues until 1,000 users have entered the channel. The number of presence event messages sent on the channel to notify of each user’s presence follows the n-squared pattern (1+2+3+4…+1000). Total number of presence events: 500,500
  • Later, as all 1000 users leave the channel, their departure is published.  Total number of presence events: 500,500
Diagram illustrating the number of presence notifications increases quadratically.
The number of presence notifications increases quadratically.

In summary: for just 1,000 presence-set members on a live event channel who are subscribed to presence events, the system will receive 2000 publish events as they enter, and later, leave. But to notify every member of those enter/leave events requires sending over 1 million notifications.

Consider if all 1,000 users joined over the space of 10 seconds: those notifications need to be published at a rate of 50k per second!

While this n-squared pattern still exists in principle, Ably now offers server-side batching of presence events, which dramatically reduces message fanout and makes large presence sets far more viable.

With server side batching enabled, presence limits can be increased significantly, up to 20,000 members depending on plan.

There is no limit on the number of clients attaching or subscribing to a channel, only on those who call enter. If you need a larger presence set, Ably can adjust limits based on your use case.

The presence set members can still retrieve an updated version of the presence set at regular intervals using get, sufficient for common features such as analytics, on-demand querying, or custom functionality.

Tip: Many large scale applications allow users to enter the presence set without subscribing to presence events. Using capability configuration or a dedicated presence channel means users can appear online without generating high fanout for every update.

About Ably Pub/Sub

Ably Pub/Sub delivers globally distributed, low-latency messaging with built-in connection management, message ordering, and exactly-once delivery semantics. It provides higher-level realtime features such as presence, occupancy, and server-side batching, helping developers build reliable synchronized experiences without managing complex distributed infrastructure.

Learn more about the Ably platform, get in touch or sign up for a free account to see what Ably can do for you.

Join the Ably newsletter today

1000s of industry pioneers trust Ably for monthly insights on the realtime data economy.
Enter your email