How to listen to the backend on the client side?

Good evening!
There's a problem, in General, that a sensible answer I in these the Internet is not found.
And so to the point, for example I want to write a notification system for the site, for example on the website there is a cherished button husky and two user(say user_1 and user_2). So, user_2 like to post user_1, user_2 id is preserved in the database under the post user_1, then I need somehow to pull user_1 and to show that he liked.
Considering how the majority of sites, is it possible in any way to send the client the info that he liked without any interaction of the client with the backend? Or it is necessary to write a demon?
I do not understand anything, thanks in advance for your help, look forward to your answers!:)
April 19th 20 at 12:15
2 answers
April 19th 20 at 12:17
The easiest way short of polling the respondents regularly APIs for new data.
A little more complicated - Long polling is the same, but the timeout is longer (usually about 20C, the gold standard)
Another sophisticate - websocket
Even more interesting - push notifications

On the server side in any case, it is necessary to generate any events or notifications, and to store for each user you want the client to receive them. There will be a table and the queue (message broker)
Thank you very much! He looked about long polling and interested, I'll use it:) - travon.Medhurs commented on April 19th 20 at 12:20
@Fern_Kreiger, health) of course, the server must be able to work in this mode - cleo commented on April 19th 20 at 12:23
@Tate.Mullhas already been posted) - travon.Medhurs commented on April 19th 20 at 12:26
@Fern_Kreiger, that's great. Please, as they say) - cleo commented on April 19th 20 at 12:29
April 19th 20 at 12:19

Find more questions by tags BackendRESTful APIFrontend