I am writing a service for file synchronization: there is a server and a large number of clients interacting with it; interaction is reduced to a simple notification of some clients about changes that have occurred on the server.
What will be more effective in this case (both in time and in the costs of system resources):
- continuously maintain a TCP connection with each client and send notifications from the server,
- or force each client every 5-10 seconds. send a UDP packet with a request for new alerts?
What approach is used for similar tasks: Dropbox, Jabber (notifications of new messages), Vkontakte?