Live Objects and Live Collections are observable data holders. The observer gets updated when there is a change of data in the local cache. There are two main sources that can make changes to the object and collection:
  1. When data get updated by an action from the current device
  2. Real-time events of the subscribed data from the server
Refer to the platform-specific subpages in this section for an in-depth explanation of how your SDK handles live objects and live collections.
By subscribing to a specific topic in the Real-time event system, users can ensure that they are receiving the most up-to-date information and notifications related to the observed object across devices.

Data Sources

Local Actions

Updates from user interactions within your current device

Real-time Events

Live changes from subscribed objects on the server

Live Object

Live Object allows users to observe the states of a single object within the app, such as a post, message, or channel. With Live Object, users can automatically receive notifications of any data updates related to the observed object, whether from the network or locally.

Key Features

Use Cases

Live Object is ideal for monitoring individual entities such as:
  • Posts: Track likes, comments, and content updates
  • Messages: Monitor delivery status, read receipts, and reactions
  • Channels: Observe member count changes and channel metadata
  • User Profiles: Watch status updates, avatar changes, and online presence

Live Object Architecture

Live Collection

Live Collection allows users to observe changes to an entire collection of data within their app in real-time. Live Collection works similarly to Live Object, with the main difference being that Live Collection notifies changes related to the entire collection rather than just a single object.

How It Works

To use Live Collection, users can observe changes in a specific collection within the SDK. The collection handler then receives a snapshot of changes since the last result, which includes three possible events:

Deletions

The indices of the objects that were deleted

Insertions

The indices of the objects that were inserted

Modifications

The indices of the objects that were modified

Change Detection

Live Collections provide granular change notifications instead of replacing entire datasets:
Change TypeDescriptionBenefit
InsertionsNew items added to collectionEfficient UI updates for new content
DeletionsItems removed from collectionSmooth removal animations
ModificationsExisting items updatedTargeted updates without full refresh

Use Cases

By subscribing to changes on a specific collection using Live Collection, users can stay up-to-date with the latest changes and updates to important collections within the app. This can be particularly helpful for:
  • Managing large amounts of data: Efficiently handle extensive datasets without performance impact
  • Monitoring frequently updated collections: Track changes to dynamic content like messages or posts
  • Real-time social feeds: Display new posts, comments, and reactions as they happen
  • Chat message lists: Show new messages instantly with typing indicators
  • Member lists: Track community or channel membership changes

Live Collection Architecture

\

Best Practices

Platform Implementation

Each platform has its own specific implementation patterns for Live Objects and Collections:
Development Tip: Use platform-specific debugging tools to monitor subscription status and data flow in your Live Objects and Collections during development.