I've developed a Socket Application on top of TCP in .NET C#, which allows many clients to send files from one another via a VPS I'm using. Most file transfers will occur between people in the same region, say, even in the same neighborhood.

So, If 300 clients are connected, some of them will be connected from say Europe, others from, say the USA etc... Those who are connected from Europe will never try to send files to those in the USA.

What matters to me the most is scalability (hopefully, I will have thousands of users connecting simultaneously), and low latency (responsiveness) when it comes to upload/download transfer rates.

Something tells me, that if I want the files (up to 2MB) to be transferred quickly between my clients, I should get a VPS in Europe, USA, Asia etc. In this way, users will get higher transfer rates, and in case one of the server fails, they will be able to use the the other one(s). Besides, I should have a separate database for user info/statistics to which all of the servers connect when needed.

My question is, what is the common practice for such usage and requirements? Any kind of clue/terminology I should start to get familiar with will be highly appreciated. Thanks

  • Whatever your solution, consider that geographical proximity and IP connection speed are not correlated. I may have a higher speed with someone on the other side of the world than with my next-door neighbour, depending on the interlink speeds of the respective ISP's. Mar 19, 2013 at 12:08
  • You mean something like dropbox or wetransfer? Mar 19, 2013 at 12:27
  • You said high performance, but what are your performance requirements?
    – Brian Snow
    Mar 19, 2013 at 13:06
  • @BrianSnow High performance for me, high transfer rate and the ability to serve many clients.
    – Daniel
    Mar 19, 2013 at 14:13
  • @LucFranken No not really. More like a torrent, only you choose exactly who you are sending the file to.
    – Daniel
    Mar 19, 2013 at 14:15

1 Answer 1


Best practice in such a problem would be to change your server to me only meta-server, while file transfer would be peer-to-peer. This is for example how Skype works.

If you don't want to rewrite whole application logic, you can use CDN. Just keep in mind, that many CDNs are designed for static content. Make sure to use one, that actually works for dynamic content. Amazon's CloudFront is one example, CloudFlare CDN is another. In this case client both upload and download would go to respective CDN endpoints (the closest ones to their internet location), then through internal CDN provider's network to your server. Combined with auto-scalable server you'll achieve practically unlimited scalability. However that will be rather expensive.

  • Let's Assume I don't wish to rewrite my whole network application, and use TCP sockets. Is there a way to distribute the servers such that the file transfer rate will increase?
    – Daniel
    Mar 19, 2013 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.