Live and In Color: Real-time Pub/Sub Messaging

2 min readDec 6, 2018

At PubNub, we’re always thinking of the simplest way to describe what PubNub does. We often turn to chat – the individual chat message being a great representation of a real-time message being sent through PubNub.

However, a PubNub message is so much more than just text. It can trigger an action, like turning on a lightbulb or firing off a transactional email. It can be a piece of data to update a live dashboard. Or it can even move a player around in a multiplayer game.

So we built a new demo app called PubNub Live and In Color, a real-time multi-user color changer. The concept is simple – users can connect to the app and change the color of every other connected users’ screen.

Try it here by opening it up in a couple browsers, or on your phone and browser  – each one is a unique connected user in this case.

You can also check out the full GitHub repo here.

However, that’s where the simplicity ends, and the complexity of what’s happening behind the scenes begins. The first is reliability at scale. Whether there are three or 3,000 users connected, you’re going to get the same real-time, low-latency changing of colors for every connected user. Secondly, global coverage. We tested this app with someone in the UK and someone in Tokyo, and still got that same seamless color changing. This is all made possible by the PubNub Data Stream Network, allow the users to connect and maintain an open connection, and deliver messages in real time. We’ve built out the infrastructure so you don’t have to.

So what’s next? This is Real-time Messaging in its simplest form. You can check out our common use cases for a wide variety of industries and verticals, or head over to our blog for some in-depth tutorials to spur your imagination. And we’re always here to talk about your next project too.

More from PubNub

How to Create a Dating App: 7 Steps to Fit Any Design
Insights6 minMar 15, 2023

How to Create a Dating App: 7 Steps to Fit Any Design

There are common underlying technologies for a dating app, and in this post, we’ll talk about the major technologies and designs...

Michael Carroll

Michael Carroll

How to Create a Real-time Public Transportation Schedule App
Build6 minMar 14, 2023

How to Create a Real-time Public Transportation Schedule App

How to use geohashing, JavaScript, Google Maps API, and BART API to build a real-time public transit schedule app.

Michael Carroll

Michael Carroll

How to Create Real-Time Vehicle Location Tracking App
Build2 minMar 9, 2023

How to Create Real-Time Vehicle Location Tracking App

How to track and stream real-time vehicle location on a live-updating map using EON, JavaScript, and the Mapbox API.

Michael Carroll

Michael Carroll

Talk to an expert