Live data from Hacker News

Serverless maps at 1/700 the cost of Google Maps API

protomaps.com

81–90 of 118 posts

Re: Serverless maps at 1/700 the cost of Google Maps API

#81

Can someone give a better description of how this initiative relates to OpenStreetMaps? The website says that the "tile dataset [is] based on OpenStreetMap data" - so, what's the added value in the commercial tier? And - how, if at all, does this initiative contribute back to OSM as a project?

It can use openstreetmap as a data source and probably most people self hosting their maps will end up using openstreetmap data and maybe some of their own data. IMHO this is more interesting for people that want bespoke maps as it gives them a cheap way to do that without having to rely on expensive SAAS solutions or a lot of operational complexity.

Openstreetmap doesn't really do a lot for hosting maps for third party websites. You would use Mapbox, maptiler or other suppliers for that and libraries such as mapbox/maplibre, openlayers, leaflet etc. that can render either bitmap or vector maps.

The trick with protomaps is that instead of deploying gazillions of tile files, you upload a huge single file with all the vector content inside and then use lambda functions to extract tiles from that file. And then you use caching and CDNs to to make sure you don't have a lot of compute overhead . So, the API looks like a normal tile server. The data deployment process boils down to uploading a new file and your usage data is a little bit of compute for the tiles your users ask for and a networking cost related to using a CDN.

So, that adds up to a lot of savings potentially. At least, as long as commercial providers don't lower their cost. Obviously, they are free to do similar things technically.

Re: Serverless maps at 1/700 the cost of Google Maps API

#82

Can any of you suggest a nice tutorial or something for rendering maps for self-hosting at much higher zoom levels? Many of these examples are for larger areas where zoom level 10 is sufficient, but I make hobby maps of mountain bike / hiking trails where the displayed area is only ~10km wide at the most with lots of fine detail. Thus, my maps tend to be shown at zoom levels 12-18, which is much higher than any of th…

Most of these examples go up to zoom 10 or so because they cover a wide area. It's not prohibitive to increase that zoom in a small area because the total number of tiles will still be low. Also keep in mind that for vector data it's possible to "overzoom" and allow the client zoom levels to be higher than the physical data levels. In terms of self hosted maps for outdoors use, I have some open source repos from a fe…

This basemap looks awesome. Need to play with this and see how hard is to run it on my own. It would totally fit nicely with my website https://travelermap.net.

Re: Serverless maps at 1/700 the cost of Google Maps API

#83
post #27

Earlier quoted context omitted.

> $350 versus $0.50! It's not as impressive as you make it sound. The real value of the Maps API is in 1) routing and 2) local business details. These are both hard for anybody else to provide, so Google prices them accordingly. The price for the tiles is just an extension to the overall pricing.

> local business details That situation is actually kind of outrageous. Municipalities and governmental bodies feed data into Google rather than publicly-accessible platforms (like OSM). And so do the private businesses, with no regulatory mechanism forcing either them to submit the same data to local / public databases (like yellow pages, national map site / registries, or OSM) or forcing Google to provide dumps of…

Yeah I agree. As near as I can tell municipalities treat Alphabet like their own data utility. They consider it an extension of their government. I have two kids in public school and those schools' reliance on these closed platforms is almost 100% complete for everything from newsletters to surveys to class sign-up and bill payment. It is the largest thing that keeps me from de-googling my life.

I'm not necessarily saying municipalities should build this stuff out themselves, only that it freaks me out when small governments rely on giant corporations to support their infrastructure.

Re: Serverless maps at 1/700 the cost of Google Maps API

#84
post #67

The thing this article doesn't say is that maplibre-gl v2 supports directly querying pmtiles with http range requests so you don't even need lambda or cloud flare workers to make x/y/z routes in front of the file. So instead of 50c, this is essentially free. If you are going to to set up that infrastructure you could just use an mbtiles file which has been around for years. The interesting thing to me is that this st…

The solution I described in the blog post is an optional layer on top designed for high traffic deployments, see here: https://protomaps.com/docs/cdn As most storage systems like S3 aren't free and have per-request fees, the price is pretty comparable to this CDN deployment. Protomaps is very intentionally built with little in common with Mapbox; the main shared parts are using the same Protocol Buffers vector tile f…

Firstly, I just want to say thanks for the reply, but more so thanks for your work, its moving opensource mapping forward.

In my work we are looking at switching from mbtiles hosted with tilserver-gl(https://github.com/maptiler/tileserver-gl) to pmtiles to remove a server process. But we were self hosting already and we are already using maplibre-gl 2.

I can see why the implementation in the blog post would be better for high traffic deployments (ours isn't). It also points out to me I don't understand how a CDN would handle range request for hosting the pmtiles file directly, it probably doesn't?

As far as the mapbox stuff,in my mind, pmtiles is a direct competitor (successor) to the mbtiles format, which was a revolution in comparison to everything that came before it. A successor I welcome because it makes it even easier for me as a developer to self host and not be dependent on a SaaS to run my maps.

The modern opensource map stack wouldn't exist without mapbox and I'm personally grateful to them for that. Most people who use pmtiles will use mapbox's opensource style spec to style them, and descendants of their open source code to render them. But as a developer now its an obvious choice to not use their services after years of using them.

However I'm not doing high traffic stuff and they never made much money off me anyway.

Re: Serverless maps at 1/700 the cost of Google Maps API

#85
post #37

Google Map 10X their price on a single price change. Never trust Google Cloud or run any production servers with them. They have zero empathy for you. Just today, we got screwed by Google Cloud (as a 4 yrs customer) when they abruptly shutdown our production servers just because we didn't fill up a form on-time. My story: https://twitter.com/Ryan_Liao/status/1634103410525077504 (happens today) [Link Updated]

a 400 month customer is really a tiny fish, don't expect special treatment without support packages. Do you even have an enterprise contract with them? The bronze contract can be had from 0 spend, and gives the option to pay through invoicing and have support. Or are you just going through credit card which is intended for hobby use? I am not defending them, but this is totally on you. What was the missing informatio…

If you can be banned from the platform at any time just for having the audacity of using your credit card, maybe they should have a big yellow warning box when signing up with a credit card

Re: Serverless maps at 1/700 the cost of Google Maps API

#86
post #27

The real meat of this story: > A web application with 50,000 map loads using the Google Maps API will cost $350 per month. > A similar amount of traffic running through a Protomaps CDN install on Cloudflare, with an average of 20 tiles per session, costs fifty cents in Cloudflare Workers request fees. $350 versus $0.50! Who's going to be the first to build a (maybe Google Maps-compatible?) API on top of this and sell…

> $350 versus $0.50! It's not as impressive as you make it sound. The real value of the Maps API is in 1) routing and 2) local business details. These are both hard for anybody else to provide, so Google prices them accordingly. The price for the tiles is just an extension to the overall pricing.

>The real value of the Maps API is in 1) routing and 2) local business details.

Google is crowdsourcing both

Re: Serverless maps at 1/700 the cost of Google Maps API

#87
post #11

Earlier quoted context omitted.

That's awesome, just saw that myself! This is a super cool project. Fwiw with "Google Maps compatible" I didn't mean showing Google's Maps, I was thinking more a drop-in replacement to (some subset of) Google's client library.

Hmm, I haven't heard of any open source projects re-implementing Google's client library, and I imagine it would be difficult to keep parity with a closed-source project. Most open source efforts have consolidated around MapLibre GL https://maplibre.org which is a maintained fork of Mapbox GL before their switch to a source-available license.

An API is an API. The code behind it being closed is irrelevant.

Re: Serverless maps at 1/700 the cost of Google Maps API

#88
In these discussions I rarely see Apple Maps mentioned, but I just checked and MapKit JS includes 25,000 requests per day with a $99 yearly Apple Developer subscription. Considering the cost of the alternatives, even if you don’t care about iOS development, it might be worth it to get one just for MapKit.

Re: Serverless maps at 1/700 the cost of Google Maps API

#89
post #27

Earlier quoted context omitted.

> $350 versus $0.50! It's not as impressive as you make it sound. The real value of the Maps API is in 1) routing and 2) local business details. These are both hard for anybody else to provide, so Google prices them accordingly. The price for the tiles is just an extension to the overall pricing.

Local business details also can be the opposite of what you want: You don't want your competitors on the map. Not sure if there are ready use alternatives, but at least in theory with OSM you could fully control what is being shown. And what not.

I will say I'm for this setup, but what you're saying is not exactly true. You can customize what is shown with the styling wizard, and completely remove types of markers from maps you create. https://mapstyle.withgoogle.com/

Re: Serverless maps at 1/700 the cost of Google Maps API

#90
This has been transformative for the project[0] I'm working on where I need to host a lot of ocean environment data using vector tiles. I've been able to build out a data upload and tiling pipeline similar to Felt using tippecanoe + pmtiles without a lot of trouble. It's so cheap to run and host we intend to provide a data hosting service free to our users with a reasonable soft limits. Using something like MapBox Tiling Service would have been a couple orders of magnitude more expensive and make the project infeasible. Really exciting stuff.

[0]: https://seasketch.org

Post reply on HN