Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can you describe a little more how you direct downloads to an in-zone copy?


I imagine using known IP ranges (https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.... & https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges....) you could redirect to local resources within their region.

I'd probably use Lamda/NodeJS with a ~20 minute in-memory range cache that should stay under 128MB of memory per instance. Perhaps I'd store all the range starts and ends each as two 64-bit ints on a database of your choice for persistence, indexing, and comparison. Finally, some code to convert IPv6 and IPv4 into 128-bit (2x64-bit ints) IPv6 integer space and back.

A second service could listen for IP range updates avoiding any bandwidth fiasco if a new range opens up with a sudden influx of traffic.


I think they were looking for a solution where you replicate the data natively and direct to that copy for a certain region, rather than cache and serve


The cloud providers all have public lists of their IP ranges, so there's a fastly ACL for each provider/zone pair and for matching IPs, some custom VCL serves a HTTP redirect to the HTTP url for the appropriate cloud provider's cloud storage solution (S3, GCS, etc.). On the VMs, these resolve to appropriate internal IPs to obtain data from the storage service without charge.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: