Compare all

Fanout vs PubNub

A comparison of realtime providers

Easily build complete, trusted realtime functionality.

Take our APIs for a spin

Disclaimer: All information is as accurate as possible as of publishing, May 2019. It’s worth noting that the information presented in this article has been gathered based on documentation and resources freely available online from Fanout and PubNub. Be sure to double-check anything before you make any decisions. If you do find anything incorrect or out of date then please let us know.

That said, the aim is to help you make a more informed decision when it comes to choosing a realtime data streaming or messaging platform. We’ll cover a set of questions we think are essential to ask of any realtime data streaming platform.

Fanout and PubNub are realtime messaging platforms offering high-throughput and realtime data delivery between online networks of users and services. Like all platforms there are pros and cons of each.

Contents

To help you answer the questions above in relation to Fanout and PubNub we’ve done our best to perform an unbiased, high-level comparative analysis of both platforms.

Is it globally fast, reliable, and redundant?

Before considering anything else you need to trust your realtime provider can deliver a stable and reliable service that’s easy to implement.

Information provided is from publicly available sources and is intended as a starting point for further investigation. See full disclaimer.

Reliability Fanout PubNub
Latency of response times No data available. Global average of 250ms. End-to-end within 100ms. See support article.
Uptime SLA 99.999% uptime SLAs. 99.999% uptime SLA for premium plans.
How many globally distributed datacenters? Four globally-distributed datacenters

The datacenter network comprises three Point of Presence locations in addition to a single Central location.
16+ datacenters and 175+ edge PoPs across Europe, USA, and Asia Pacific.

This equates to four Amazon geographical regions and ten EC2 availability zones with AWS.
Latency based routing that ensures users connect to the closest datacenter Supports latency based routing. Supports latency based routing.
Mesh architecture with no central point of failure Unknown. Yes.
Data replicated in multiple regions Unknown. Partial.

Full data replication is guaranteed only for Enterprise customers.
Quality of Service and message delivery guarantee (never lose data during brief disconnections) Shaky.

With Fanout, if a message is published whilst a client is briefly disconnected (if they are going through a tunnel, for example), then the message may never arrive to that client.
Partial.

PubNub imposes a message queue limit of 100 messages. Message recovery cannot be guaranteed and subscribed clients are at risk of missing messages if disconnected.

The comparisons presented here are: (i) derived from public information and open sources available as of May 2019, and thus may be outdated; (ii) intended as a starting point for further investigation; and (iii) not guaranteed to be 100% accurate or complete. The reader is encouraged to conduct an independent evaluation and to not rely solely on the information presented here. Please contact us if you believe the information here is inaccurate or incomplete.

PubNub references:

PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA13, PA14, PA15, CL1, CL2, CL3

What’s the level of platform interoperability?

The modern internet is a web of different languages, platforms, open and proprietary protocols, and services built on top of other services. This isn’t likely to change anytime soon so a platform that supports widespread interoperability is essential in the long-term. There are three questions to help assess how interoperable a platform is:

  • How extensively does the platform support different languages, frameworks, and protocols?
  • How easy is it to migrate to or move away from the platform?
  • Are there protocols for streaming data into third party platforms?

Information provided is from publicly available sources and is intended as a starting point for further investigation. See full disclaimer.

Interoperability Fanout PubNub
Support for native client libraries/SDKs 6 SDKs. Claims support across 70+ SDKs.
Support for open source and proprietary protocols (e.g. MQTT, AMQP, STOMP) Limited. Partial.

PubNub supports MQTT but requires additional configuration opposed to native out-of-the-box support.
Migration and lock-in Does not support proprietary realtime vendor protocols, making it harder to migrate in and away. Does not support proprietary realtime vendor protocols, making it harder to migrate in and away.
Coverage of various languages, frameworks, protocols and transports, including MQTT Limited. Fanout supports a few server environments; Python, Ruby, Php, Node, Golang, and .NET.

HTTP stream is offered for languages they do not support.
Partial. No support for third party queuing, streaming, or compute platforms.

PubNub Functions provides a proprietary method of executing code. Unfortunately this limits you to PubNub’s functionality, their JavaScript API, and means you’re required to reproduce existing code already in your systems.

The comparisons presented here are: (i) derived from public information and open sources available as of May 2019, and thus may be outdated; (ii) intended as a starting point for further investigation; and (iii) not guaranteed to be 100% accurate or complete. The reader is encouraged to conduct an independent evaluation and to not rely solely on the information presented here. Please contact us if you believe the information here is inaccurate or incomplete.

PubNub references:

PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA13, PA14, PA15, CL1, CL2, CL3

How easy is it to get started and scale up?

We all want to work with platforms and technologies that are easy to understand, implement, and then scale. When it comes to realtime platforms you can get a good feel for this by looking at:

  • The user-friendliness of the API
  • The documentation

Is the API easy to use: Getting set up with Fanout

Looking at the official Node.js Client here is how to publish a message using Fanout:

var grippub = new grip.GripPubControl({
    'control_uri': 'https://api.fanout.io/realm/<myrealm>',
    'control_iss': '<myrealm>',
    'key': new Buffer('<myrealmkey>', 'base64')});
// Add new endpoints by applying an endpoint configuration:
grippub.applyGripConfig([{'control_uri': '<myendpoint_uri_1>'},
    {'control_uri': '<myendpoint_uri_2>'}]);
// Publish across all configured endpoints:
grippub.publishHttpResponse('<channel>', 'Test Publish!', callback);
grippub.publishHttpStream('<channel>', 'Test Publish!', callback);

Is the API easy to use: Getting set up with PubNub

Here’s how publishing a message with Node.js and PubNub is done:

var PubNub = require('pubnub');
var pubnub = new PubNub({
    publishKey: 'demo',
    subscribeKey: 'demo'
});
var publishConfig = {
    channel: 'hello_world',
    message: {
        title: 'greeting',
        description: 'hello world!'
    }
};
pubnub.publish(publishConfig, function (status, response) {
    console.log(status, response)
});
Which API is best?

Looking at the code-blocks above, both APIs are easy to use.

Is the documentation any good?

Documentation is the bedrock of understanding and using software, especially for such complicated and essential functionality as realtime messaging. Nowadays this is a really low bar but far too many services still have minimal, incomplete, or no documentation at all. Clear and succinct documentation is usually a good indication that the service is well-designed and you’ll be able to find the information you need. And if they’re using the OpenAPI Specification then that’s a good sign too.

Do Fanout and PubNub make the grade? Both do well with fairly extensive documentation across quickstart guides, SDKs, and docs explaining core features of their respective platforms, along with some topics around streaming data in general.

As an aside, Fanout’s documentation has a good step-by-step flow for each language and functionality. PubNub seems to focus on helping you select your programming language and providing a more in-depth implementation, with less description and stage-by-stage guidance.

Connectivity and transport

How your data/messages are transported changes the speed of delivery and fundamentally impacts your product or service. A realtime platform provider should always choose the best transport available based on the browser and connection available. The client library should prioritize transports in this order:

Fanout provides WebSocket support, with fallback to XHR and Long Polling for older browsers. It also offers HTTP streaming.

Whereas PubNub rely on the HTTP transport protocol for their client libraries, a WebSocket compliant interface is provided in some libraries, however this is just a wrapper around an underlying HTTP transport.

The general consensus in the realtime industry is that the WebSocket protocol is a faster, more efficient transport option than HTTP. And while, at the moment, HTTP is more widely supported (although as of early 2019 the difference is small and rapidly shrinking) many believe WebSockets will become the universally-accepted standard for streaming data in the near future.

How mature is the feature set?

It takes non-trivial engineering effort to adopt a realtime data streaming platform and integrate into your application or service. It’s natural you’ll want to make sure the platform you choose has a mature and full feature set that provides the basic the functionality you’d expect from a realtime platform, provides the features you need right now, and has the functionality to support you as you grow and your needs change.

Below is a feature matrix with a set of standard features you’d expect to see on offer from an established realtime data streaming platform. Fanout and PubNub are compared side by side against these features.

Information provided is from publicly available sources and is intended as a starting point for further investigation. See full disclaimer.

Features Fanout PubNub Why does it matter?
Realtime data streaming Yes. Yes.
Message and worker queues No.

Fanout does not offer any message queuing features or ways to distribute data using once-only pattern to your server workers.
No.

PubNub does not offer any message queuing features or ways to distribute data using once-only pattern to your server workers. However, PubNub Functions appears to be an alternative function-as-a-service approach.
Message queues that provide a reliable and straightforward mechanism to consume, process, store, augment or reroute data efficiently from a realtime platform.
Webhooks Yes. Partial.

PubNub supports Webhooks if manually requested through support. However they are limited to presence events and do not cover channel lifecycle events.
Webhooks provide a means to get messages, channel lifecycle and present events pushed to your servers over HTTP.
Serverless cloud function invocation Limited. Partial.

PubNub allows you to run code on their own platform using their proprietary PubNub Functions. The code you can run is limited to the available Javascript API.
Trigger serverless functions on third platforms like Amazon Lambda, Microsoft Azure or Google Function.
Presence No. Yes.

PubNub supports a default announcement of 20 members and a self-configurable maximum of 100 members per channel.
Subscribe to events when users or devices enter or leave channels/topics.
Message history No. Yes. Dictates whether clients can access historical activity, catching up on missed messages.
Realtime data firehose No. No. Stream your realtime data published within a realtime platform directly to another streaming or queueing service such as Amazon Kinesis, Apache Storm or Kafka.
Native push notifications No. Yes. Send notifications and updates to users even when they are offline.
Custom domain endpoint (CNAME) Yes. No.

PubNub only provides support for custom CNAME for non-TLS connections as they do not serve up custom certificates for customers.
Custom domains allowing you to connect using a CNAME such as “realtime.your-company.com”.

The comparisons presented here are: (i) derived from public information and open sources available as of May 2019, and thus may be outdated; (ii) intended as a starting point for further investigation; and (iii) not guaranteed to be 100% accurate or complete. The reader is encouraged to conduct an independent evaluation and to not rely solely on the information presented here. Please contact us if you believe the information here is inaccurate or incomplete.

PubNub references:

PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA13, PA14, PA15, CL1, CL2, CL3

The matrix shows both DSNs offer good levels of basic realtime messaging functionality. Integrated features, notably Webhooks, save you some engineering heavy-lifting. The fact PubNub offers push notifications and proprietary solutions for serverless functions gives this company a headstart in terms of off-the-shelf engineering integration.

Both fall short when it comes to features that would allow you to substantially scale your realtime offering – though again PubNub fares marginally better with its message history and presence features. Notable here on both counts is a lack of realtime data firehose, lack of reliable messaging ordering and lack of message and worker queues – omissions that are worth preemptively bearing in mind if you plan to scale your offering.

Whereas PubNub’s feature coverage is wider, both platforms provide very feasible options for meeting your realtime needs. Using this feature matrix as a guide, it is worth checking the platform functionality in relation to your own specific requirements and preferences, both now and further down the line.

Does the platform offer realtime API Management tools?

Current realtime data streaming providers can give you the much-needed core transfer infrastructure for realtime data, but the burden of managing realtime APIs is still with you – REST API management tools are popular for a reason. Some headache-busting questions to ask:

  • In addition to realtime streaming infrastructure, does the DSN come with operational tools to deploy and manage streaming APIs? (Think hosted endpoints, analytics, developer portals, and rate-limiting tools.)
  • Is end-to-end data delivery supported (i.e. from source to destination) for your streaming APIs? Can you send data straight from IoT sensor to smartphone, without needing to pass through your own servers first?

PubNub offers little in this regard, compensating to some extent by readymade realtime SDKs such as chatkits. Fanout is significantly ahead of the curve here, offering to ‘make realtime push CDN delegable’. It allows users to link to its open-source realtime proxy, Pushpin, with established REST API management systems (Kong, Apigee and so on), to ‘turn your flat API endpoints into dynamic push’. The complexity of realtime streaming make end-to-end integration modules an extremely handy tool, that will help you overcome a number of engineering obstacles. Although Fanout’s realtime service uses REST API management tools, and won’t offer a seamless or native streaming experience, this is still a useful tool to have.

How secure is the platform and the way it does things?

Security and encryption are front of mind and any realtime platform will have robust security built into their design and delivery. A good general checklist for security is:

Information provided is from publicly available sources and is intended as a starting point for further investigation. See full disclaimer.

Security Fanout PubNub Why does it matter?
TLS connection Yes. Yes. TLS connections ensure all data in transit is encrypted.
Token-based authentication Yes. No.

PubNub offers an authentication scheme called PAM that allows granular permissions to be configured per client. These permissions are stored on PubNub’s servers however which means it is your responsibility to keep a client’s permissions in sync with PubNub at all times.
Token-based authentication ensures private keys are never shared and instead short-lived tokens are used to authenticate.
JSON Web Token (JWT) Yes.

Fanout uses Runscope JWT authentication.
No. JWT allows for easy integration with existing authentication systems, along with ensuring private keys are never shared.
Configurable private key permissions No. No. API keys with configurable permissions including restrictions on channels or operations.
Configurable channel permissions No. Yes. The flexibility to maintain control of your channels, such as requiring SSL/TLS or only identified authenticated clients on a channel.
Encrypted message payloads No. No. AES encryption using the provided private key before publishing to a network. As a result, messages are practically impossible to intercept and view. For sensitive data this ensures your payloads are always secure and opaque.

The comparisons presented here are: (i) derived from public information and open sources available as of May 2019, and thus may be outdated; (ii) intended as a starting point for further investigation; and (iii) not guaranteed to be 100% accurate or complete. The reader is encouraged to conduct an independent evaluation and to not rely solely on the information presented here. Please contact us if you believe the information here is inaccurate or incomplete.

PubNub references:

PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA13, PA14, PA15, CL1, CL2, CL3

Some further details:

Fanout

  • Fanout Cloud supports SSL for nearly all methods of connectivity. The built-in realm domains (i.e. {realm-id}.fanoutcdn.com)can be accessed with either http/ws or https/wss schemes.
  • For custom domains, it’s possible to upload your own certificate to be used for SSL. Fanout Cloud supports TLS Server Name Indication (SNI) so that a dedicated IP address is not needed for SSL.
  • For traffic proxied to origin servers, it’s possible to specify origin server settings for SSL and non-SSL traffic. If both are provided, then Fanout Cloud will use whichever one matches the scheme of an incoming request.
  • URLs subscribed to receive Webhooks may use either http or https.

PubNub

  • PubNub, on the other hand, offers TLS and AES256 encryption, plus support for BYOE (bring-your-own-encryption) models.
  • PubNub Functions support flexible authorization schemes via any OAuth and LDAP model.
  • HIPAA Compliance, SOC 2 Type 2 Compliant, Privacy Shield certified, and GDPR compliant.
  • PubNub interestingly offers EU And US-Only Data Storage by Routing data streams and store messages solely within the EU for added PII compliance.
  • PubNub also offers an access manager, which boasts of fine-grain access control API for data streams which allows you to Segment permissions by channel, user, or channel group.

How responsive and helpful is support?

Even if a platform or product is well-designed and the docs are strong, the nature of software and complex infrastructure means you’ll inevitably need to talk to a human at some point. Whether it’s about pricing, implementation, or a bug – support is a fact of building stuff on the internet. So it’s essential you can rely on responsive, helpful support.

Good indicators are short response times across live chat and email, access to people who understand the nitty gritty technical details of the platform, and an up-to-date support portal for docs. An active community with forums or a group chat can also be a good sign.

Fanout’s support

Fanout base support on the plan you’ve subscribed to. For free plans, Fanout’s user community can offer advice, while for business plans, the team itself offer email support.

PubNub’s support

PubNub seems to provide more extensive and responsive support but does require you to purchase support plans in addition to paying for PubNub’s core service:

  • Both ticket-based and web-based chat support
  • A comprehensive support home, knowledge base, and glossary provide ample self-help collateral
  • If you’re really struggling PubNub offer a consultancy-style service
  • All pricing tiers include ‘basic support’ which entails ‘best-effort’ response times through email and web. Then there’s premium support plans:


PubNub support options

There’s no listed pricing for support plans so we can’t comment on the value.

It’s clear that PubNub offer robust support as long as you’re willing to pay for it.

How clear, flexible, and scalable is the pricing structure?

Both Fanout and PubNub offer free and paid plans.

What do you get for free?

Fanout’s free ‘Hacker’ plan offers a maximum concurrent client count of 20, 500 minutes per day connected client time, 500 received and delivered messages per day with no SLA. If you’re using Fanout’s free plan you have to rely on its community for your support needs. For small-scale users Fanout offers an open source proxy Pushpin. While it’s beyond the scope of this review to evaluate Pushpin’s pros and cons, it is worth also bearing this option in mind.

PubNub offers 1m Transactions and 1GB Data Persistence, with access to their Chat Engine. PubNub does not mention SLA on their free plan.

What do you get for your money?

Fanout

For the paid plan, Fanout offers a $25 monthly plan, where you pay $4 per million messages sent and delivered and $4 per million minutes connected. The diagram below, taken from Fanout’s pricing page, details the benefits of its paid vs free plans.


Fanout pricing options

It is worth noting Fanout’s paid accounts are $25 plus usage costs. You pay for extra minutes and/ or connections during peak moments. You also pay extra if you exceed your messaging limits.

Fanout operate a usage-based pricing scheme but charge customers based on the connected client time rather than peak connections. If clients are connected with idle connections for long periods of time then costs can quickly add up.

PubNub

PubNub charges over four categories. The scheme is quite complex.

PubNub offers a $45 monthly plan, which is said to be ‘prepaid toward your transaction usage’. Transactions are priced as follows:

  • $0.000075 per Replicated Transaction (i.e. API calls that result in information replicating across multiple PubNub Points-of-Presence, a concept also known as a ‘message’).
  • $0.000020 is the price of an Edge Transaction (i.e. API calls that interact with a single PubNub PoP, such as receiving a published message via a Subscribe API call).
  • $0.000025 per Functions Execution (each execution of a PubNub function).
  • $8 per GB Data Persistence (data calls that store data into PubNub – this could be Storage & Playblack, the Key/ Value store, and others).

Here’s what the scheme looks like in table form on PubNub’s site:


Pubnub pricing options

PubNub lets you pay for the resources you use in a package format. However, pricing is based on transactions which are classified into more than 40 different types, making it difficult to predict ongoing costs. In addition to being complicated, PubNub tends to price higher than other providers.

The following two examples, based on common usage scenarios, outline how each pricing scheme plays out in practice.

Example 1

A chat application that serves 100,000 customers per month, each of whom on average use two ten-minute chat sessions, which include 20 messages, averaging 1KB in payload, in each direction between customer and operator.

With Fanout, this would result in the following:

  • 100,000 customers * 2 sessions * 20 messages per session = 4,000,000 messages a month for sending messages.
  • 100,000 customers * 2 sessions * 20 messages per session = 4,000,000 messages a month for receiving messages.
  • 10 minutes chat session * 2 sessions * 100,000 customer = 2,000,000 minutes a month

At $4 per million minutes and $4 per million messages, cost of a minute and message = $0.000004 respectively.

Total cost = $25 +($0.000004* 4,000,000) +($0.000004 * 4,000,000) +($0.000004*2,000,000)= $25 + $16 + $16 + $8 = $65/month

With PubNub, this would result in:

For each session:

  • 1 Edge Transaction to open the session between the client and PubNub
  • 20 Edge Transactions for receiving 20 messages(subscribing to messages)
  • 20 Replicated Transactions for 20 messages(publishing messages)
  • 40KB of Data Persistence for the 40 messages(persisting the data)
  • 1 Edge transaction to close the session
  • Total: 22 Edge Transactions; 20 Replicated Transactions; 40KB written to Storage & Playback(Data Persistence)

Total cost:

  • 100,000 users with two session per month = 200,000 sessions
  • Total: 4.4M Edge Transactions, 4M Replicated Transactions, 8GB written to Storage & Playback
  • Total Cost:
    • Edge: 4.4M * $0.000020= $88
    • Replicated: 4M * $0.000075=$300
    • Data Persistence: 8GB * $8 = $64
    • Grand total: $452/month

Example 2

Taxi dispatch company with 500 cabs that can be hailed through a smartphone. When a user makes a request for a ride the backend will check which drivers are online by using the here_now() call. Once the user is matched with a driver, the cab location is published twice a minute to the user. On average, a ride lasts for 15 minutes.

With Fanout, this would result in:

  • 15 minutes connected per ride = 15 * $0.000004
  • 30 messages publishing lat/long from cab phone to rider = 30 * $0.000004
  • 30 messages receiving lat/long during the ride = 30 * $0.000004

Total cost per ride

  • Minutes connected = $0.00006
  • Messages sent and received = $0.00024
  • Total cost = $25 + $0.00006 + $0.00024 = $25.0003

With PubNub, this would result in:

For each session:

  • 1 Edge Transaction per mobile to open the connection to PubNub
  • 1 Edge Transaction per ride request to determine online drivers
  • 30 Replicated Transactions per ride – publishing Lat/long from cab phone to rider
  • 30 Edge Transactions per ride – rider subscribing to lat/long information during the ride.
  • 1 edge call per mobile device to close the connection to PubNub

For each ride

  • 35 Edge Transactions
  • 30 Replicated Transactions

Total cost per ride

  • Edge : $0.0007
  • Replicated : $0.00225
  • Total cost : $0.00295

To sum up, Fanout is a cheaper alternative to PubNub. However, the pricing schemes of both providers require users to look carefully at what their streaming needs are now, and in future, to make sure invoices remain free of unpleasant surprises. With both providers, the option exists to talk to the respective teams directly to discuss volume-based discounts.

Which platform is best?

‘Best’ is subjective here, depending on developer needs. Below is a recap of the major differences:

  • In terms of streaming infrastructure PubNub’s network is more developed, with better coverage and mesh architecture.
  • While neither offer delivery guarantee, PubNub offers a basic message queue limit
  • PubNub offers message history, Fanout doesn’t
  • PubNub offers better – but by no means exhaustive – language and platform coverage, claiming support for 70+ SDKs.
  • Fanout supports webhooks, whereas PubNub only partially supports these
  • Fanout offers you basic ways of managing your streaming APIs, PubNub doesn’t.
  • In terms of security features, Fanout’s network is marginally better secured, with features such as token-based authentication and JWT that PubNub lacks. However the two companies adopt significantly different approaches and it is worth looking at the details to see which best fits your needs.
  • Both offer flexible, usage-based pricing with the option of customized plans. Fanout works out marginally cheaper based on the use cases in this study.

To sum up, with many additional valuable features such as server-side functions, a chat engine, push notifications, presence and better support options, PubNub appears to have a technically-superior offering.

If you’re just looking to get something up and running, and don’t want an initial influx of potential users (who may just be testing the waters with your service) to cause you to exceed your plan too quickly, then Fanout will likely fit the bill.


Compare these companies with other realtime providers