Live data from Hacker News

I made a simple geolocation service

maxkostinevich.com

101–110 of 187 posts

Re: I made a simple geolocation service

#101

Regarding latency of AWS Lambda: > on average the response took somewhere between from 200ms to 500ms I'm getting latency of 66ms to 126ms with some simple Java code running on AWS Lambda using provisioned concurrency. I find the latency is just fine for most use cases.

"using provisioned concurrency"

What's the point of using Lambda if you have to provision capacity for it?

You pay a premium on the compute because it's able to scale down to zero (so in theory, it works out cheaper anyway), but in reality it only works well when you do everything in your power to have it not scale down to zero.

Re: I made a simple geolocation service

#102
post #25

I had to tackle this problem as well for a small project and found that I could just send a GET request to https://www.cloudflare.com/cdn-cgi/trace and parse the response with a simple regex: /loc=(\w*)$/gm The response time averages 10ms and is free, granted I'm not sure if there is a ToS or anything attached to this endpoint, I've only found non-conclusive discussion here https://community.cloudflare.com/t/what-are…

It is worth mentioning that /cdn-cgi/trace doesn't only work under www.cloudflare.com. It works for any https?://DOMAIN_WITH_CLOUDFLARE/cdn-cgi/trace . It is an easy to determine whether a website is using CloudFlare or not too.

Re: I made a simple geolocation service

#103
post #35

Earlier quoted context omitted.

The only thing I like about lambda, is that your code could easily be deployed to different geo locations

You can also easily spin up a VM in a different geographic location.

If you spun up a VM in 200 locations like Cloudflare, that $3 VPS suddenly becomes $600

Re: I made a simple geolocation service

#104

How does MaxMind prevent someone from releasing an open source version of their database? If you are about to answer "Copyright", remember - you can't Copyright facts. This has been upheld in the Courts system many times.

> If you are about to answer "Copyright", remember - you can't Copyright facts.

Nope, US law was changed over a decade ago.

Re: I made a simple geolocation service

#105
post #98

I applaud your efforts but it's disingenuous to title this how you "made a geolocation service" when you are just reading a field in someone else's geolocation service.

Indeed. Using another service and being a wrapper around it is not all that impressive. He is also using workers which makes his solution expensive. I run ifconfig.io which now gets just over a billion hits a day. It is basically an echo service, and it just parrots back what cloudflare tells it. But since I run it on linode, it costs me a whopping $40 dollars a month for 35 billion returns a month. Using workers wou…

Great service, thanks for running it!

Re: I made a simple geolocation service

#108
post #98

I applaud your efforts but it's disingenuous to title this how you "made a geolocation service" when you are just reading a field in someone else's geolocation service.

Indeed. Using another service and being a wrapper around it is not all that impressive. He is also using workers which makes his solution expensive. I run ifconfig.io which now gets just over a billion hits a day. It is basically an echo service, and it just parrots back what cloudflare tells it. But since I run it on linode, it costs me a whopping $40 dollars a month for 35 billion returns a month. Using workers wou…

Thanks for sharing. This is a perfect example which proves lambda/serverless/cf worker are snake oils.

Re: I made a simple geolocation service

#109
post #89
post #22

Google App Engine had this quite a while ago (almost a decade, I think)and a very generous free tier. Also has approx lat-long, city, state and country. https://blip.runway7.net https://github.com/runway7/blip I lost track of the consumer apps I've used this on and still haven't received a $1+ bill.

Is there a good lat/lon to timezone database that lets you leverage this into a presumptive timezone offset from UTC and thus local time?

[deleted]

Re: I made a simple geolocation service

#110
post #14

I (like many others it seems!) have also built a geolocation service however mine is built on top of MaxMind's DBs that are mentioned in the post. Its on a few boxes running OpenResty and now handles 130m+ requests/day. Was really fun to build! https://github.com/jloh/geojs https://www.geojs.io/open/

[deleted]
Post reply on HN