Culture / Development / Edge / IoT / Machine Learning / Serverless

PubNub Offers Serverless Programming for Real-time Streaming Services

26 Sep 2016 6:37am, by

Amid all the talk about serverless computing and programming on the network edge, San Francisco-based PubNub is making both a reality.

PubNub’s JavaScript-based API enables developers to add real-time communications to their apps, whether it be real-time chat, a multi-player game or remotely-controlled Internet-of-Things devices.

Using the company’s global data stream network (DSN), PubNub Blocks allows developers to code application logic directly into the network, relieving the need for setting up servers to handle specific tasks.

The services, or “blocks,” come from both PubNub and third-party providers, and can be embedded into a streaming workflow to handle tasks such as IP blocking, geolocationing and geocoding, and filtering.

A company with a popular brand may want to build a chat app so its users can have an online real-time experience during a big event. This is where PubNub blocks can come in handy, said Wendy Schott, PubNub chief marketing officer.

“What you don’t want is someone to use profanity or use a competitor’s name. Right now, for a developer to build that, if you type in a chat message, they have to take that message, push it down to a big bunch of servers that are doing nothing but parsing your message to look for profanity, look for a competitor’s name and replace it, then put it back on the network, then publish it out to everybody. They have to have a slew of servers to do that one simple function — parsing the message,” Schott said.

“With PubNub Blocks, they can write a small piece of JavaScript and that will allow them to run in our network at every edge node around the world. As that message is sent, we will parse it on the fly, run the logic and push it out with low latency and no spin-up time.”

She calls it the embodiment of Cisco’s concept of fog computing. In fact, Cisco and Ericsson just chipped in another $6 million, raising the company’s total funding to $46.1 million.

The company uses 15 data centers around the world, so devices using PubNub code connect to the data center closest to them. All the processing is done at the network edge — not sent to some centralized server.

“We’re basically a big CDN for real-time networking and real-time computing,” Schott said.

The network already publishes 1.8 trillion messages a month on more than 330 million devices.

Using persistent socket connections, the service allows users to:

  • Publish messages into channels they can create on the fly.
  • Detect whether devices are online or offline.
  • Store data streams for playback – if you join a chat late, for instance, you can go back and catch up.
  • Subscribe to thousands of channels through a single connection.

Its HTTP-level request and response also can be used with Internet-of-Things devices to alert on anomalies quickly – allowing users to call for repairs, for instance – while data is still being sent back for analysis.

The company augments its services with partnerships with other online service providers, including IBM Watson, Wolfram Alpha and SendGrid. If, for example, you want your chat in English, but also translated to three other languages, you can have IBM Watson do that for you on the fly, Schott said.

It supports 70 different SDKs such as game-development tool Unity, Go, Raspberry Pi and more. Though its own code is proprietary, it also supports open source projects such as Project EON, which connects C3 charts and Mapbox’s map widget for creating dashboards and visualizations.

There are a range of open source projects covering open sockets, including SocketCluster for Node.js and RudeSocket for C++. And it competes with the likes of Realtime, Pusher and Google on that front.

Its customers include Logitech, Adobe and Autodesk, though Schott said it’s gaining traction within healthcare because it is HIPAA compliant.

She described three layers of security:

  • Transport Layer Security (TLS), which encrypts the packet being transferred.
  • Advanced Encryption Standard (AES): “And we do not keep the keys. We have no access to unencrypt the user’s data,” she said.
  • Its own access manager: Developers control access down to the person, device or channel.

“If you have someone on a chat who gets vulgar, you can write a script limiting that person to listen, but not write on that channel, or block that person entirely. It’s done globally on every edge node in less than a quarter of a second,” she said.

On September 28, PubNub will host a conference about web streaming in San Francisco, Stream Conf 2016, featuring talks by Cisco, Gorilla Logic, Microsoft, Mozilla, Signal FX and others.

September 28, 2016 // San Francisco @ The Bentley Reserve

September 28, 2016 // San Francisco @ The Bentley Reserve

Everything is changing: from the software architectures that power data streams to the business models that turn them into growing businesses. Join technology thought leaders, software architects and developers to explore how always-on data streams will be managed, scaled, secured, and monetized in the months and years to come. If you’re responsible for bringing always-on applications or connected devices to market, this is an event you won’t want to miss! Save $100 using discount code TNS-100

Cisco and IBM are sponsors of The New Stack.

Feature Image: “Message board” by MIKI Yoshihito, licensed under CC BY 2.0.

A newsletter digest of the week’s most important stories & analyses.

View / Add Comments

Please stay on topic and be respectful of others. Review our Terms of Use.