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

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




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

Search: