1

I'm designing a file sending system from a server to many remote clients, around 5000; each file has only one recipient client. Files rarely exceed 10MB. The server is published on the internet, the clients access the internet but cannot be reached from the outside. I'm evaluating two solutions.

  1. Expose a WebApi on the server, which each client calls every few minutes (polling) to ask the server if there are files for it, and download them if necessary, again via WebApi.
  2. Use a technique, such as WebSocket, where each client establishes a connection to the server, and the server, when it has a file available for a client, sends the file directly, in push mode.

I'm evaluating what would be the best approach.

The first solution is certainly simpler to implement, but I thought with the second one I would be able to have better response times and lower resources usage; however I don't know if the latter may have some delicate aspect to manage.

Any ideas? Thanks

3
  • What ‘better performance’ do you expect with sockets? What is an acceptable time for a download to start after a new file is available? Commented Jul 28, 2023 at 11:16
  • The waiting time from when a file is available is not fundamental, but I meant more in terms of resources used, service reliability and in general which solution is preferable Commented Jul 28, 2023 at 12:28
  • 4
    If you don’t need real-time communication, go with polling. Commented Jul 28, 2023 at 13:48

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.