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.
- 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.
- 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