5

I have a scenario, where i need check if my Database has received new orders (restaurant).

Signalr seems to be the best option.

But I can wait 2-3 minutes to update with AJAX.

Given this long range I can expect, and thinking of a large scale, would not ajax be better?

  • Possible duplicate of [Is SignalR a suitable substitute for jQuery Ajax (or similar)](https://stackoverflow.com/questions/10654690/is-signalr-a-suitable-substitute-for-jquery-ajax-or-similar) – Matthijs Oct 13 '18 at 16:50
  • Yes this question says it would be better to use signalr, but I still have doubts about the large range that I can expect, which would have a better performance. – Mickael Puygcerver Oct 13 '18 at 16:55

1 Answers1

6

Although this looks like a duplicate of: Is SignalR a suitable substitute for jQuery Ajax (or similar), I'd say you should use SignalR, based on the chosen answer to the similar question.

SignalR is perfect for notifying users real-time. You can call client functions from the server and vice versa. This makes it very dynamic.

I think it would be more heavier to call an endpoint every 2 minutes – even if there was no order placed – then only perform an action when an order has been placed.

The capacity for concurrent connections depends on the performance of the server.

Matthijs
  • 2,483
  • 5
  • 22
  • 33
  • Thanks for the reply, I was confused because the interval is too big. And I do not know how much it takes to keep an open connection to the signal with hundreds or thousands of clients. – Mickael Puygcerver Oct 13 '18 at 17:18
  • SignalR will be able to handle it. The performance depends on the server you run it on. – Matthijs Oct 13 '18 at 17:20
  • 1
    If you are looking for some info regarding, check out this twitter post - https://twitter.com/anurse/status/983406560880701440 and as David Fowler stated - "this was a max concurrency test and we still haven’t maxxed it out yet". So, hundreds and thousands generally are not going to be an issue as Matthijs said. Heck, even the older (.NET) was tested out to 150,000 connections. – Frank M Oct 15 '18 at 20:28