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

CometD

18
34
+ 1
0
SignalR

488
1.2K
+ 1
146
Add tool

CometD vs SignalR: What are the differences?

Introduction

In this article, we will discuss the key differences between CometD and SignalR. Both CometD and SignalR are popular web application frameworks used for real-time communication between the client and server. However, they have some distinct features and capabilities that set them apart. Let's explore the differences in detail.

  1. Architecture: CometD is based on the publish-subscribe pattern, where messages are broadcasted to multiple subscribers. It follows a decentralized model and is suited for more complex and distributed systems. On the other hand, SignalR uses a client-server architecture, where clients establish a connection with the server and communicate directly. It is well-suited for simpler and small-scale applications.

  2. Transport Protocols: CometD supports a wide range of transport protocols such as WebSocket, long-polling, and streaming. It provides fallback mechanisms to choose the best transport protocol based on browser capabilities. In contrast, SignalR primarily relies on WebSocket for real-time communication. It has built-in support for fallback protocols like Server-Sent Events (SSE) and long-polling for browsers that do not support WebSocket.

  3. Platform Compatibility: CometD is a Java-based framework and can be used with Java-based servers. It has client libraries available for various languages including Java, JavaScript, and Objective-C. SignalR, on the other hand, is a Microsoft technology and primarily used with .NET and ASP.NET. It has client libraries available for .NET languages like C# and JavaScript.

  4. Server Scalability: CometD is highly scalable and can be used in a clustered environment. It supports distributed server setups and handles failover and load balancing effectively. SignalR also provides scalability options but is more suited for smaller-scale deployments. It may require additional configurations and setup for clustering and load balancing.

  5. Bi-directional Communication: Both CometD and SignalR support bi-directional communication between the client and server. However, SignalR provides more fine-grained control over data transmission, allowing clients to invoke methods on the server and receive responses. CometD focuses more on pub-sub messaging and may not provide the same level of flexibility for server-side invocations.

  6. Community and Ecosystem: SignalR has a larger community and ecosystem compared to CometD. It has extensive documentation, official tutorials, and third-party libraries available for various use cases. CometD, while less popular, still has an active community and provides robust support for its users.

In summary, CometD and SignalR differ in their architectural approaches, transport protocols, platform compatibility, server scalability, communication capabilities, and community ecosystems. Each framework has its strengths and weaknesses, and the choice between them depends on the specific requirements of the application.

Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of CometD
Pros of SignalR
    Be the first to leave a pro
    • 32
      Supports .NET server
    • 25
      Real-time
    • 18
      Free
    • 16
      Fallback to SSE, forever frame, long polling
    • 15
      WebSockets
    • 10
      Simple
    • 9
      Open source
    • 8
      Ease of use
    • 8
      JSON
    • 5
      Cool
    • 0
      Azure

    Sign up to add or upvote prosMake informed product decisions

    Cons of CometD
    Cons of SignalR
      Be the first to leave a con
      • 2
        Expertise hard to get
      • 2
        Requires jQuery
      • 1
        Weak iOS and Android support
      • 1
        Big differences between ASP.NET and Core versions

      Sign up to add or upvote consMake informed product decisions

      - No public GitHub repository available -

      What is CometD?

      It is a web server to push data to a browser, without the browser explicitly requesting it. It is an umbrella term, encompassing multiple techniques for achieving this interaction.

      What is SignalR?

      SignalR allows bi-directional communication between server and client. Servers can now push content to connected clients instantly as it becomes available. SignalR supports Web Sockets, and falls back to other compatible techniques for older browsers. SignalR includes APIs for connection management (for instance, connect and disconnect events), grouping connections, and authorization.

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

      What companies use CometD?
      What companies use SignalR?
      See which teams inside your own company are using CometD or SignalR.
      Sign up for StackShare EnterpriseLearn More

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

      What tools integrate with CometD?
      What tools integrate with SignalR?

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

      What are some alternatives to CometD and SignalR?
      Socket.IO
      It enables real-time bidirectional event-based communication. It works on every platform, browser or device, focusing equally on reliability and speed.
      RabbitMQ
      RabbitMQ gives your applications a common platform to send and receive messages, and your messages a safe place to live until received.
      Kafka
      Kafka is a distributed, partitioned, replicated commit log service. It provides the functionality of a messaging system, but with a unique design.
      Apache Camel
      An open source Java framework that focuses on making integration easier and more accessible to developers.
      Atmosphere
      The Atmosphere Framework contains client and server side components for building Asynchronous Web Applications. The majority of popular frameworks are either supporting Atmosphere or supported natively by the framework. The Atmosphere Framework supports all major Browsers and Servers.
      See all alternatives