Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ajax with set Interval OR SignalR

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?

like image 743
Mickael Puygcerver Avatar asked Oct 13 '18 16:10

Mickael Puygcerver


1 Answers

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.

like image 83
Matthijs Avatar answered Sep 25 '22 02:09

Matthijs