Product Updates

Introducing App Context: User and Channel Metadata Storage

3 min readNishith Agarwal on Jun 4, 2020

We’re happy to announce that PubNub has released a new version of App Context that provides easy-to-use and serverless storage for user metadata, channel metadata and channel memberships. Developers can now store data that is common to their applications without having to spin up additional backend infrastructure and services. Manage your data and build innovative, reliable, and scalable applications on PubNub using the new and improved App Context.

Solving the Real-time Data Store Problem

Building chat applications shouldn’t require you to spin up backend infrastructure to support what users consider native or part of the app itself. Before App Context, developers using PubNub had to spin up their own services to store and fetch metadata for the users, channels and channel memberships that were used in their applications.

This need to requisition extra infrastructure took away from the ability to build quickly easily on PubNub. Not only does this take a developer’s time away from actually building the features, but it puts the extra costs of maintaining new services on the builder — not exactly what you expect when you think about building an app like chat on a platform like PubNub. Scaling these services can be another challenge, especially if you have millions of users accessing this data as they get chat rooms, add memberships, show chat room members, among other things. This presents a serious challenge of keeping your application real-time for your customers the way that they expect.

App Context take this pain away from developers so they can focus on providing the best end-user experience on their apps instead of worrying about infrastructure. With App Context, developers can simply use our pre-built services to set metadata for users and channels, add and remove channel memberships for a user, or add members to a channel, all without deploying additional servers or setting up database tables. Now that’s what you expect when you work with PubNub.

Key Features

Scalable Storage for User and Channel Metadata

Store user properties like a user’s name, email address, and profile info as metadata on the user record. Similarly, store channel properties like channel name and description. This metadata can be set, removed and fetched from the database.

Managing Channel Memberships

Create and store associations between users and channels. A user can belong to multiple channels, and a channel can have multiple members. Use Memberships to access these associations from the App Context database.

Real-time Data Events

Receive events in real time when user / channel metadata is set or when channel memberships are modified in the App Context database. Client applications can receive these events to update a user’s profile or show an alert when a user is added to a channel.

What's New in Version 2

With the introduction of App Context v2, PubNub has simplified and streamlined the service to integrate it with our core services. You can use new methods in your PubNub SDKs to store metadata for users and channels to use this data in your applications without spinning up additional backend infrastructure.

App Context Version Difference

How to Start Using App Context

New to PubNub? Great! You have nothing to worry about. You can start using App Context methods in the SDK by enabling the App Context feature from your Admin Dashboard. Just turn it on and select the region that should host your data. That's it, now you’re ready to use the App Context to store metadata for your application.

If you’re already using App Context for your applications, you can continue to do so on the existing version of the PubNub SDKs. No action is required if you don’t plan to upgrade your SDK versions at this time. If you would like to try App Context, you can do so by following the migration guide. Note that your existing data will not migrate automatically when you upgrade to the new schema. If you wish to retain your data, you can reach out support team at who will be happy to assist you to migrate objects data from your account.