Hi,
CDNs use a number of different techniques, as I mentioned, to make sure that users are sent to the correct server for their location, one of those techniques is Anycast, most often used on DNS Servers, but some like CacheFly use it for the HTTP as well.
To make use of Anycast you’re going to need to be running your own BGP network, with carefully selected providers - preferably the same 2 or 3 providers in each location (it’s a long story, but if you don’t, you’ll end up with lots of users ending up on the wrong side of the world potentially), along with local peerings.
If you’re just making use of Anycast for your DNS then you’re going to need some serious intelligence inside of your DNS system to work out which servers are the most suitable for a particular user - this will most likely include looking in to the BGP tables, as well as regularly testing latency to the prefixes in the table from each of your locations - then feeding that back in to all of your DNS nodes, so they know that given the users IP X, that server Y has the lowest latency connection to it.
On top of that, you’ll also want to include in the metrics used by the DNS system some semblance of server load - it’s no good sending a user to the server with the lowest latency if it’s got more load than it can handle.
Those are all things a CDN should do, and more on top.
At the end of the day, if using a CDN works out at the same monthly cost as just renting 30 servers - then the CDN is cheaper, as you’ve got less costs with the CDN, such as writing the software, administering it on a day to day basis. Also, with the servers, it’s not just the cost of renting the servers, you’re actually going to have to run your own network if you want to do it properly (even if it’s just for your DNS servers) and to the same level that you’d be paying someone for.
By all means, go the DIY route, but go in with your eyes open and don’t expect it to be cheaper than paying someone once you’ve factored your time in and all other costs, especially for such modest requirements.
Thanks,