I'm in the beginning of creating a small CDN for our streaming server needs.
I know, that there are multiple ways to route a user to an ideal server:
- Anycast for the whole HTTP traffic: Let the network in help of BGP figure out which is the ideal server. This would be the premium solution, but very few provider offer it and it's it's not cheap.
- GeoIP DNS Services (like AWS Route 53): It seems like the way to go for a project like mine. What gives me headaches however is the problem, that I have to change my DNS nameservers of my domain. This is a problem, because I need those nameserver point to CloudFlare, because of DDoS protection.
- The third option, which let my nameservers point to CloudFlare (and be protected against DDoS attacks) would be a backend, which will return the geographic nearest video server. I think something like that can be implemented with Python.
By the way, all my video server will be behind a load balancer, so a backend doens't have to care about health status.
I'm unsure if I should just go with Route 53 and accept the risk of a DDoS attack or go with a less flexible approach and let the backend decide, which video server the user gets.