Need advice about which tool to choose?Ask the StackShare community!

PubNub

237
457
+ 1
238
Socket.IO

13.2K
10.8K
+ 1
776
Add tool

PubNub vs Socket.IO: What are the differences?

Introduction

PubNub and Socket.IO are both popular real-time communication frameworks used in web development. While they share similar functionality, there are key differences between the two.

  1. Scalability: PubNub is designed for global scalability, offering a distributed network of data centers that can handle high volumes of messages across multiple geographic regions. On the other hand, Socket.IO relies on server infrastructure, which may limit scalability in terms of handling large-scale real-time communication.

  2. Device Compatibility: PubNub provides client libraries for a wide range of platforms, including web browsers, mobile devices, and IoT devices. This makes it suitable for building applications that seamlessly run on different devices. Socket.IO is primarily focused on web platforms and may not have extensive support for other types of devices.

  3. Real-time Message Routing: PubNub uses a publish/subscribe messaging model, where messages are sent to channels and subscribers receive messages from those channels. Socket.IO, on the other hand, uses a bidirectional event-based communication model, allowing clients and servers to send and receive arbitrary events.

  4. Reliability: PubNub offers built-in features like message replay, message history, and guaranteed message delivery, which ensure reliable real-time communication. Socket.IO, while it provides basic reliability features, may require additional configuration or third-party libraries to achieve the same level of reliability.

  5. Presence Detection: PubNub includes built-in presence detection, allowing developers to determine the online status and activity of connected clients. Socket.IO does not provide native presence detection and requires additional implementation to track client connections.

  6. Encryption and Security: PubNub provides end-to-end encryption, protecting data transmitted between clients and servers. It also offers access control mechanisms for securing channels and limiting message access. Socket.IO, while it supports secure connections, may require additional configuration to achieve the same level of encryption and security.

In summary, PubNub offers global scalability, extensive device compatibility, reliable message delivery, built-in presence detection, and encryption features. Socket.IO, on the other hand, is primarily focused on web platforms, offers bidirectional event-based communication, and may require additional configuration for scalability, reliability, presence detection, and encryption.

Advice on PubNub and Socket.IO
Moghammad Sabre Khan
Needs advice
on
FirebaseFirebase
and
Socket.IOSocket.IO

We (my team) are building an App where we want to have Bi-directional texting, Single Directional Picture, and audio transfer.

We are building all this using Flutter.

There will essentially be 3 apps, 2 Mobile-based (Android and iOS) and 1 Microsoft Based. We've built up most of the code already, and made a few major mistakes but fixed it(namely had no proper state management).

How things will work:

Person A has a Mobile app 1, Person A presses a button that sends a "communication request" into a Pool of requests. Person B on Desktop App chooses a "communication request" from the pool, and engages in Bi-directional texting with Person A. Person B also opens communication with Person C who is on Mobile app 2, and they engage in Bi-directional texting. Person C will be notified of communication requests through Push Notifications.

So far we've been using Socket.IO, however, I'm starting to think that's not the best.

A problem we've encountered so far is that Person A(Mobile App 1 User), is the person who sends a "communication request" into the "Communication Pool". The Mobile App 1 User, can "cancel" the communication at any point in time. When they do that, I would like for a notification to be sent to Person B, the Desktop User, For them to pick up another communication request.

I am not sure how this should be done however, should it be done in the Back-end, then how does the Front-end get notified of the change?

Any advice on which to choose?

See more
Replies (1)
Jomai Omar
web developer at tunisofts · | 3 upvotes · 17.8K views
Recommends
on
FirebaseFirebaseSocket.IOSocket.IO

It's so simple when you use Firebase to manage the requests just make new field to the request for example callstate with values like "requesting" "incall" "cancelled" and both A and B can update this field.

See more
Needs advice
on
AblyAblyPubNubPubNub
and
PusherPusher

I am building an IoT application that will utilize connected air quality sensors to provide real-time indoor air quality in offices. I want to be able to share this data with a few different databases, etc.

Wondering if anyone has any advice on which real-time streaming API would be best for this sort of application, or even how I should think about it?

See more
Replies (2)
Ben Gamble
Recommends
on
AblyAbly

For IoT, we support MQTT along with websockets and SSE. The pattern you're suggesting that involves harvesting data from devices and soaking into a database is easy to achieve with one of the Ably integrations (Serverless functions/webhook) . Here are some tutorials to do things like this: https://ably.com/tutorials/reactor-event-zapier#step2-mqtt-ably

See more
Philip Rossen
Recommends
on
PusherPusher
at

We use Pusher at www.justlearn.com. It works fine. When you reach more users, Pusher gets expensive. We use Pusher for live chat between users. Their software is easy to use. We have had issues with auth on Pusher.

See more
Needs advice
on
ApolloApolloFirebaseFirebase
and
Socket.IOSocket.IO

We are starting to work on a web-based platform aiming to connect artists (clients) and professional freelancers (service providers). In-app, timeline-based, real-time communication between users (& storing it), file transfers, and push notifications are essential core features. We are considering using Node.js, ExpressJS, React, MongoDB stack with Socket.IO & Apollo, or maybe using Real-Time Database and functionalities of Firebase.

See more
Replies (3)
Timothy Malstead
Junior Full Stack Developer at Freelance · | 7 upvotes · 486.9K views
Recommends
on
FirebaseFirebase

I would recommend looking hard into Firebase for this project, especially if you do not have dedicated full-stack or backend members on your team.

The real time database, as you mentioned, is a great option, but I would also look into Firestore. Similar to RTDB, it adds more functions and some cool methods as well. Also, another great thing about Firebase is you have easy access to storage and dead simple auth as well.

Node.js Express MongoDB Socket.IO and Apollo are great technologies as well, and may be the better option if you do not wish to cede as much control to third parties in your application.

Overall, I say if you wish to focus more time developing your React application instead of other parts of your stack, Firebase is a great way to do that.

See more
Recommends
on
AblyAbly

Hello Noam 👋,

I suggest taking a look at Ably, it has all the realtime features you need and the platform is designed to guarantee critical functionality at scale.

Here is an in depth comparison between Ably and Firebase

See more
Recommends
on
8base8base

Hey Noam,

I would recommend you to take a look into 8base. It has features you've requested, also relation database and GraphQL API which will help you to develop rapidly.

Thanks, Ilya

See more
Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of PubNub
Pros of Socket.IO
  • 36
    Massively scalable & easy to use
  • 25
    Easy setup
  • 20
    Reliable
  • 19
    Great support
  • 14
    Flexible to integrate to custom applications
  • 13
    Sockets at Scale
  • 13
    99.999% availability guarantees
  • 13
    High-Performance
  • 12
    High-Reliability
  • 12
    Multiplexing
  • 7
    Scalability
  • 5
    High-Availability
  • 5
    70+ SDKs
  • 4
    Security
  • 4
    Azure Add-on
  • 3
    Heroku Add-on
  • 3
    Presence
  • 3
    Flexible
  • 3
    Easy to setup
  • 2
    Data Streams
  • 2
    Free Plan
  • 2
    Server-Side Cache
  • 2
    PhoneGap Plugin
  • 2
    AngularJS Adapter
  • 2
    Data Sync
  • 2
    Analytics
  • 2
    Support
  • 1
    Easy setup and very reliable
  • 1
    High cost, going up more in Summer '15
  • 1
    Cool
  • 1
    Angular 2+ integration
  • 1
    Documentation, easy to use, great people/service
  • 1
    CTO stephen also is A++++++
  • 1
    Real time and easy to use.
  • 1
    Easy integration with iOS apps
  • 219
    Real-time
  • 143
    Node.js
  • 141
    Event-based communication
  • 102
    Open source
  • 102
    WebSockets
  • 26
    Binary streaming
  • 21
    No internet dependency
  • 10
    Large community
  • 6
    Push notification
  • 5
    Ease of access and setup
  • 1
    Test

Sign up to add or upvote prosMake informed product decisions

Cons of PubNub
Cons of Socket.IO
  • 1
    Costly
  • 12
    Bad documentation
  • 4
    Githubs that complement it are mostly deprecated
  • 3
    Doesn't work on React Native
  • 2
    Small community
  • 2
    Websocket Errors

Sign up to add or upvote consMake informed product decisions

What is PubNub?

PubNub makes it easy for you to add real-time capabilities to your apps, without worrying about the infrastructure. Build apps that allow your users to engage in real-time across mobile, browser, desktop and server.

What is Socket.IO?

It enables real-time bidirectional event-based communication. It works on every platform, browser or device, focusing equally on reliability and speed.

Need advice about which tool to choose?Ask the StackShare community!

What companies use PubNub?
What companies use Socket.IO?
Manage your open source components, licenses, and vulnerabilities
Learn More

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with PubNub?
What tools integrate with Socket.IO?

Sign up to get full access to all the tool integrationsMake informed product decisions

Blog Posts

Vue.jsSpring BootUnity+7
2
1261
JavaScriptPythonPubNub+4
7
1583
What are some alternatives to PubNub and Socket.IO?
Pusher
Pusher is the category leader in delightful APIs for app developers building communication and collaboration features.
SendBird
SendBird is a Messaging SDK, Chat API, and fully managed chat infrastructure for your mobile apps and websites. Embeddable chat for iOS, Android, JavaScript, Unity, .NET.
Stream
Stream allows you to build scalable feeds, activity streams, and chat. Stream’s simple, yet powerful API’s and SDKs are used by some of the largest and most popular applications for feeds and chat. SDKs available for most popular languages.
Kafka
Kafka is a distributed, partitioned, replicated commit log service. It provides the functionality of a messaging system, but with a unique design.
Ably
Ably offers WebSockets, stream resume, history, presence, and managed third-party integrations to make it simple to build, extend, and deliver digital realtime experiences at scale.
See all alternatives