Need advice about which tool to choose?Ask the StackShare community!
PubNub vs SignalR: What are the differences?
Introduction:
PubNub and SignalR are both real-time communication technologies used for building interactive and responsive web applications. While they share the same purpose, there are several key differences between the two.
Scalability: PubNub is a global Data Stream Network (DSN) that provides a highly scalable infrastructure for real-time messaging. It offers a distributed publish/subscribe model that allows unlimited concurrent connections, making it ideal for applications that require massive scalability. On the other hand, SignalR is a real-time web framework for ASP.NET applications, which means it relies on the underlying scalability of the hosting platform. While SignalR can scale by adding more servers, it may not be as scalable as PubNub for extremely large-scale applications.
Platform and Language Support: PubNub provides excellent support for a wide range of platforms and languages, including web, mobile, and IoT devices. It offers SDKs for popular languages such as JavaScript, Python, Java, iOS, and Android. SignalR, on the other hand, is primarily focused on the .NET ecosystem and is built specifically for ASP.NET applications. While there are community efforts to provide SignalR client libraries for other platforms, its support outside of the .NET ecosystem may not be as extensive as PubNub.
Ease of Use and Integration: PubNub offers a developer-friendly API that is straightforward to use and integrate into any application. It provides robust client libraries and a RESTful HTTP API for publishing and subscribing to real-time messages. SignalR is tightly integrated with the ASP.NET framework, making it easy to use within ASP.NET applications. However, integrating SignalR into non-ASP.NET applications may require additional effort and dependencies.
Real-Time Features: PubNub is designed specifically for real-time communication and provides a rich set of features out of the box, such as presence detection, chat history, and channel multiplexing. It also offers additional capabilities like IoT device communication, geolocation-based messaging, and streaming data analytics. SignalR, while capable of real-time communication, doesn't come with built-in features like presence detection or chat history. These features need to be implemented manually or through additional libraries.
Flexibility and Customization: PubNub provides a high degree of flexibility and customization options. It allows developers to define their own message formats, implement custom security rules, and build complex message routing logic. SignalR, being a framework, provides a certain level of customization but may have limitations compared to PubNub in terms of message format and routing flexibility.
Reliability and Fault Tolerance: PubNub has a global infrastructure with multiple data centers, ensuring high availability and fault tolerance. It automatically handles network issues, message retries, and fallback options when connectivity is temporarily lost. SignalR relies on the hosting server's reliability and network infrastructure, which may vary depending on the deployment environment. While SignalR can be made reliable and fault-tolerant by employing strategies such as server clustering, it requires additional configuration and infrastructure setup.
In summary, PubNub offers unparalleled scalability, broad platform/language support, and a rich set of features out of the box. It is a global Data Stream Network designed for real-time communication. SignalR, on the other hand, is a real-time web framework primarily focused on the .NET ecosystem, offering good integration with ASP.NET applications but may have limitations in terms of scalability and platform/language support.
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?
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
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.
Pros of PubNub
- Massively scalable & easy to use36
- Easy setup25
- Reliable20
- Great support19
- Flexible to integrate to custom applications14
- Sockets at Scale13
- 99.999% availability guarantees13
- High-Performance13
- High-Reliability12
- Multiplexing12
- Scalability7
- High-Availability5
- 70+ SDKs5
- Security4
- Azure Add-on4
- Heroku Add-on3
- Presence3
- Flexible3
- Easy to setup3
- Data Streams2
- Free Plan2
- Server-Side Cache2
- PhoneGap Plugin2
- AngularJS Adapter2
- Data Sync2
- Analytics2
- Support2
- Easy setup and very reliable1
- High cost, going up more in Summer '151
- Cool1
- Angular 2+ integration1
- Documentation, easy to use, great people/service1
- CTO stephen also is A++++++1
- Real time and easy to use.1
- Easy integration with iOS apps1
Pros of SignalR
- Supports .NET server32
- Real-time25
- Free18
- Fallback to SSE, forever frame, long polling16
- WebSockets15
- Simple10
- Open source9
- Ease of use8
- JSON8
- Cool5
- Azure0
Sign up to add or upvote prosMake informed product decisions
Cons of PubNub
- Costly1
Cons of SignalR
- Expertise hard to get2
- Requires jQuery2
- Weak iOS and Android support1
- Big differences between ASP.NET and Core versions1