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