Show HN: Host a planet-scale geocoder for $10/mo (blog.ellenhp.me)
Geocoders are expensive to run. Like, really expensive. Like, $100+/month per instance expensive unless you go for a budget provider. I've been poking at this problem for about a month now and I think I've come up with something kind of cool. I'm calling it Airmail. Airmail's unique feature is that it can query against a remote index, e.g. on object storage or on a static site somewhere. This, along with low memory requirements mean it's about 10x cheaper to run an Airmail instance than anything else in this space that I'm aware of. It does great on 512MB of RAM and doesn't require any storage other than the root disk and remote index. So storage costs stay fixed as you scale horizontally. Pretty neat.
Demo here: https://airmail.rs/#demo-section
Writeup: https://blog.ellenhp.me/host-a-planet-scale-geocoder-for-10-...
Repository: https://github.com/ellenhp/airmail
35 comments
[ 2.7 ms ] story [ 80.6 ms ] threadEither way this looks really cool and I’ll give it a try!
Even if I'm off by a little bit or if EC2 prices are a bad benchmark, the fact remains that you need 100x less RAM to run Airmail than Nominatim, which felt novel enough to post about.
In general, reserved instance prices are a better number for "cheapest way to run a thing on AWS.
I find https://instances.vantage.sh/ is a good way to look for the pricing info.
It says an x2gd.xlarge in us-east-1 has 64gb ram and costs $72 USD/mo (on a 3 year reservation paid up-front).
Good luck! Don't use Airmail in prod (yet?), if that thought crossed your mind. It's just a demo for now and that's probably how it should stay for a while longer :)
https://serverhunter.com is amazing
When you write like this it sounds very unprofessional. Also you are basically saying "this is really expensive, unless it isn't".
Why is there any difficulty in this at all? Why would this even need to be something someone subscribes to? It is basically a nearest neighbor search.
Edit: In addition to the RAM requirements, you need a persistent volume containing the entire index attached to each serving instance, which is a real bummer when you want to scale horizontally.
> When you write like this it sounds very unprofessional. Also you are basically saying "this is really expensive, unless it isn't".
Likewise actually, it's kind of unprofessional to respond in this way to somebody's personal writing style for a writeup on her personal blog about a personal project. Go read some other Show HN thread, there's lots of genuinely cool stuff here, no need to pick on someone for writing in a way you disapprove of.
This is just as unprofessional and condescending.
edit: Looks like it is in fact against the rules, but I think I'm tentatively going to leave the comment up because I did provide a valuable answer to the parent commenter's question. Mods can do what they will of course. :)
No. This is a demo of an open-source project that I've released for free.
> To me it seems like something that has been around for a very long time and is now being resold under a new label of "geocoding"
That's just what this class of software is called.
https://developers.google.com/maps/documentation/geocoding/o...
https://docs.mapbox.com/api/search/geocoding/
https://geocode.earth/
https://github.com/komoot/photon
https://nominatim.org/
https://pelias.io/
https://www.here.com/platform/geocoding
https://developer.tomtom.com/geocoding-api/documentation/geo...
https://geocoding.geo.census.gov/geocoder/
https://github.com/Qwant/mimirsbrunn
All of these call themselves geocoders.
> 25 years ago tiny contained $100 GPS units had the entire US on a 2 GB flash card.
Yeah! Super cool feat of engineering accomplished mostly by requiring you to do structured search, if I remember correctly. I never drove with one as they were a bit before my time. I remember them being very fiddly, but that was an observation I made from the back seat of a car as a child so, grain of salt. And yes to google maps offering this for free as a part of their maps client. Not free if you're a 3rd party software developer though, as you'll see if you click through the first link I posted above.
Geocoding is one of those _hard_ problems and this really seems like a great step forward.
I’ve enjoyed my brief dalliances with digital cartography. I’m grateful for a stack like this that I can explore.
Remarkable.
I'm curious about the comparison between those two.
I admit I am a bit lost with all the new search options: tantivy, quickwit, sonic, meilisearch, zinc, toshi, lnx... A lot have popped up, particularly out of the Rust community, and I have a hard time keeping up.
From the README, it works only on SSD.
All those projects serve different purposes, and several are not actively maintained.
- Meilisearch: It provides a search-as-you-type experience and comes with many features; I don't know it very well, but I think it targets first e-commerce/application search.
- Quickwit: it's a distributed search engine for append-only data and works well on S3, a good fit for observability/security/financial/... data.
- Sonic: it looks like it targets search-as-you-type use cases and does not provide many features (which can be a very good feature in itself as it remains very light).
- Tantivy: It's a library; you need to build your server on top of it if you want an HTTP API. toshi, lnx did. It's used by a lot of search projects like tabbyML, Milvus, bloop, paradedb, airmail...
https://stract.com/
https://github.com/StractOrg/stract
https://news.ycombinator.com/item?id=39254172
One trick part when working on "planet-scale" is parsing and matching the results for multiple countries. I tried some addresses in Brazil without success. Queries like "Starbucks Sao Paulo" return some results but addresses like "Avenida Paulista 100" (or its variations) don't.
Last time I looked (~2018) pelias-parser used some ML training and the results weren't very good for Brazil. I'm guessing in 2024, an open-source fine tuned LLM would do a good job?