What is a Real-Time Data API?
A real-time data API is a collection of APIs that provide data that represents a recent change in an environment immediately, whether the environment is physical (natural processes) or virtual (instant messaging, social media). The data provided from a real-time data API is distinguished from archived or historical data, and the data is processed within seconds or milliseconds in order to be useful. For example, you might receive a notification on your mobile phone when your smart coffee machine switches on or documents you are working on are updated when multiple users are collaborating simultaneously, all in real time.
Real-time data is information as it happens and must be efficiently processed and delivered to produce a responsive, real-time experience in the following areas, amongst others:
Text, audio, and video chat communications
Multiplayer gaming and interactive art
IoT device control and smart automation
Content syndication and marketing
Alerts, notifications, and up-to-date informational services
The basic architecture of the Internet, founded on a client-server (request-response) model, was not designed for real-time data sharing. A real-time data API solves this problem by leveraging the power of PubSub, Push, Streaming, and Event-Driven APIs. Each API’s strengths and functionality is leveraged to produce a responsive, real-time experience.
A Pub/Sub (or Pub Sub) API is a Publish Subscribe messaging software design pattern that describes the flow of messages (send and receive) between applications, devices, or services in terms of a publisher-to-subscriber relationship.
A publisher (i.e. any source of data) sends messages out to interested subscribers (i.e. receivers of data) via live-feed data streams known as channels (or topics). All subscribers to a specific publisher channel are immediately notified when there are new messages received on that channel, and the message data (or payload) is received together with the notification.
This publish and subscribe functionality is used in PubNub’s real-time data api to ensure any message sent will be delivered anywhere in the world in under 100ms. Messages are reliably delivered with message catch-up on dropped connections, automatic compression, and bundling.
ClassDojo, a virtual classroom management tool depends on PubNub's scalability and reliability to ensure that its global community of students, teachers, and families can communicate in real time. Luni, a mobile app publisher and developer, uses PubNub to deliver chat at scale in their social betting app.
Understand how PubNub uses Pub/Sub API functionality through different industry use-case resources.
A Push API will receive push notifications asynchronously sent from a server to a device instructing the device to perform some action. A push message results in a notification being displayed on mobile devices even if the device is on standby, informing the users that new data is available.
PubNub supports two messaging server providers: Firebase Cloud Messaging (FCM) and Apple Push Notification service (APNs). The messaging server will send a new chat message to the device, and if the user has the chat app open, the message will appear in the conversation. If the chat app is in the background, the device will show the user a notification instead. Device Notifications are strongly linked with push use cases since they allow applications to perform work in the background.
PubNub’s Mobile Push Gateway bridges native PubNub publishing with these third-party push notification services, so that developers can use the real-time data API to send both PubNub messages and push notifications to different platforms, all in one publish call.
Kustomer uses PubNub to power support chat and push notifications in their CRM platform, enabling customers to resolve requests quickly. NurseGrid uses PubNub to power real-time scheduling updates and in-app messaging, helping to reduce inefficiencies in nurse scheduling.
A Streaming API, or Firehouse API, is a steady stream of all available data from a source in real time – a giant spigot that delivers data to any number of subscribers at a time. The stream is constant, delivering new, updated data as it happens.
The amount of data in the can vary with spikes and lows, but nonetheless, the data continues to flow through the firehose to any number of recipients. Once received, that data can be visualized, published, graphed; really anything you want to do with it, all in real time.
PubNub incorporates the functionality of Streaming APIs in its real-time data API to have unlimited data channels and powerful stream multiplexing and filtering to provide the design patterns to build any application, such as for finances, virtual events, medical emergencies, and more.
Invstr uses PubNub to power real-time data streaming, along with direct messaging and group chats in their investing app, helping users to make more informed financial decisions. vFairs leverages PubNub to provide real-time, in-app chat - reliably and at scale - to the attendees of remote conferences, trade shows, and more.
Learn more about how PubNub incorporates the functionality from Streaming APIs through Real-time Streaming and Virtual Events applications.
Real-time messaging refers to the distribution and delivery of messages that are designed to be consumed or otherwise used in real time (i.e. as events occur and no later).
Real-time messaging on the web typically involves a system in which data is streamed or pushed to users, applications, or devices with an appropriate real-time delivery mechanism such as Publish/Subscribe. The concept can also be compared with something as simple as a webhook, which provides the ability to push updates out from an app to external URLs as they occur. Real-time messaging protocols often feature support for online presence information (e.g. green: online, red: offline) for when it is useful to know a user's, or device's, availability.
PubNub’s real-time data API incorporates event-driven API features called Event Listeners. These listeners allow a single point to receive messages, signals, and presence events. Each event type has its own handler to receive them where you implement your custom app logic to perform actions on events.
Discover how PubNub uses the functionality from event-driven APIs through developer resources that instruct, demonstrate, and build applications in different use cases and industries.
PubNub’s real-time data API allows users to develop powerful event-driven applications for real-time communication by leveraging the power of PubSub, Push, Streaming, and Event-Driven APIs. This allows for one platform to build any in-app experience securely and reliably.