58

What is the difference between the newly release ASP.NET WebHooks and Signal-R? What are the advantages or disadvantages? What are the use cases for each technology?

Henrik Frystyk Nielsen
  • 3,092
  • 1
  • 19
  • 17
Muhammad Rehan Saeed
  • 35,627
  • 39
  • 202
  • 311

2 Answers2

60

SignalR is for notification within an ASP.NET app using WebSockets. You can exchange event notifications through WebSockets, however it requires a constant network connection.

WebHooks are for event notification across other web applications and other external services. (Think B2B communication). For instance, you can receive a WebHook when someone sends you money to your PayPal account. PayPal fires off a POST request to your predefined URL handler and then your app does something with that notification. You pre-configure everything on the PayPal side first. You also set up an application to handle the incoming POST request. The event notification is "pushed" to you in (near) real-time. No need to hold open a network connection while waiting for events.

The two can be complementary. For example, when you receive the WebHook from PayPal, you can notify a logged in user on your webapp (using SignalR/WebSockets) that money has been received successfully.

TLDR: Event notification across different web applications

Tim P.
  • 2,903
  • 24
  • 26
  • what is more suitable for mobile applications? for example if i have a mobile app with local sqlite and cloud database. whever I change something i want my local sqlite to be updated. – Emil Apr 21 '17 at 15:00
2

It really depends on service you want to integrate with and how. WebHooks is a simple pattern for integrating event notifications across different SaaS services. If the service you want to integrate with supports WebHooks then you can use that. If it supports SignalR then you can use that. In that sense the two are quite complementary.

Check Henrik F Nielsen post at http://blogs.msdn.com/b/webdev/archive/2015/09/04/introducing-microsoft-asp-net-webhooks-preview.aspx

ram hemasri
  • 1,624
  • 11
  • 14
  • But if I had to choose something today to do event notification. Which one would you choose and why? – Muhammad Rehan Saeed Sep 16 '15 at 08:05
  • 4
    Depends if you want real time constantly connected updates (where you would use SignalR) or subscribe to events that might happen in the future updates (where you would use WebHooks). – Lee Dale Oct 05 '15 at 12:45