Protomaps Blog

Serverless Maps using Lambda or Cloudflare Workers

Note: Mantle has been open-sourced and renamed, please see the latest blog post!


In my last post, I described the downsides of the existing “pay-as-you-go” business model for maps. Organizations searching for a map solution weigh the benefits and drawbacks of build vs. buy. Buying a hosted SaaS — and letting someone else manage infrastructure for you — makes sense when DIY map infrastructure looks like this diagram:

In this post, I’ll introduce Mantle, the commercial offering of the Protomaps system. It’s the same backend that powers the interactive Leaflet maps on this site, like at Protomaps Downloads. It enables scalable hosting of map data with two moving parts:

Runs in your own cloud account

Mantle is a commercial product bundling the open source components of the Protomaps ecosystem into a planet-scale, deployment-friendly solution for organizations.

It has a mere two components:

  • A serverless app that runs on either AWS Lambda @ Edge or Cloudflare Workers.
  • A global basemap vector tile dataset derived from OpenStreetMap and delivered as a single 62 GB PMTiles archive that lives on S3 or compatible storage.

With this combination, you get near-infinite storage space and scaling, edge caching for low latency, and security with SSL and CORS, powered by your existing cloud account and CDN.

Mantle is not a SaaS

I’ll emphasize here that this solution is not Software as a Service (SaaS). It is licensed for a flat fee and self-hosted. It lives in your own AWS or Cloudflare account, but involves zero server management, databases or certificates.

The software industry has shifted to hosted services because the diversity of on-premise installation induces fractal complexity. “Serverless” computing offers an elegant path forward: Mantle takes less than an hour to set up in your own account, and deployment of the CDN code is merely pasting a JavaScript snippet:

Differentiation in Maps

The market for map APIs is crowded. Google Maps pioneered selling a hosted API to developers, and has maintained its lead in data completeness and quality. Rivals to the Google Maps API such as MapBox and even AWS and Microsoft offer more affordable plans, but stick to the pay-as-you-go business model with a focus on the most profitable market segments.

While the Protomaps system has a lot of catching up to do in cartographic refinement, it has a key disruptive advantage over incumbents. A Mantle installation enables you to serve unlimited map tile traffic, incurring only the costs of the underlying storage and CDN. Unlike hosted services, you’re free to cache, transform, and re-combine the data as you see fit for your application with no vendor lock-in.

To illustrate the cost savings, every additional 1,000 users that load a map on Google Maps costs 7 USD. An additional million hits to Cloudflare Workers costs fifteen cents. Even taking into account the additional cost of storage and bandwidth, there’s a 10x to 100x difference in total costs.

Pricing

The introductory pricing for Mantle is a flat, per-site license of 950 USD a year, for integration into one End Product. You can continue to run Mantle after your one-year expires, but won’t have access to updated software, datasets or support.

Funding Open Source

Mantle is a capstone product for the ecosystem of Protomaps tools, covering a spectrum of technolology from spatial databases to TypeScript map rendering, as well as free, ODbL packaged geodata at Protomaps Downloads. All software components are published under commercial-friendly, permissive BSD licenses, and you can assemble a production-ready system from them.

Protomaps is currently a single-person, bootstrapped business, which removes the constraints of a typical tech startup. My intent is for the majority of mapping users — hobbyists, NGOs, corporations, everything in between — to use it completely for free. A first commercial offering is the entry point for businesses to support the development of this open source ecosystem, influence its future, and get expert support for their own environments and datasets.

Get Started

Mantle has been tested by early users for a few months, and I’m gradually onboarding new customers with personalized support. If you’d like to take advantage of the introductory pricing, fill out this short form and I’ll get in contact via email.