News for hackers. Stuff that matters.
Re:I made a simple geolocation service by layoutIfNeeded on Friday July 24, 2020 @06:06AM (#23937669)
Can you make a geolocation service from static files? 2^32 IP4 addresses with 2 floats per address would take only 34 gigabytes of storage. Put 256 addresses in a given file, and turn the other three octets into folders. E.g. https://example.com/192/168/0.txt would contain the location for addresses 192.168.0.0-192.168.0.255.

Would this be cheaper than running these services?

Re:I made a simple geolocation service by hansitomani on Friday July 24, 2020 @06:13AM (#23937709)
You could also generate all those files, put that into a GCS Bucket and put an API Gateway in front.

easier would be and thats just a thought: You could build a go/c++/java app which contains that database pre compressed in some arbitrary better format than just 2 floats, get it down from your original 34gig and just keep it in memory.

Like if you know that 99% of all ips in a certain range are from US, then only store the 1% as a list.

Re:I made a simple geolocation service by layoutIfNeeded on Friday July 24, 2020 @06:34AM (#23937827)
Sure, but my point was that it can be done with zero compute cost. There's nothing cheaper than serving static files from cloud storage.
Re:I made a simple geolocation service by hansitomani on Friday July 24, 2020 @06:47AM (#23937903)
That is just not true.

GCS for example and its the same with S3, costs space, egress and requests themself.

Data Storage 50 GB Standard Storage * $0.026 per GB $1.30 Network 10 GB egress * $0.12 per GB $1.20 Operations 10,000 Class A operations * $0.05 per 10,000 operations $0.05 Operations 50,000 Class B operations * $0.004 per 10,000 operations $0.02

Re:I made a simple geolocation service by zrail on Friday July 24, 2020 @08:36AM (#23938717)
MaxMind sells their databases as files as well as APIs. GeoLite is free to use but not as accurate as their paid products.