Figuring out web map infrastructure
In a recent project, I've got the chance to learn more about web mapping architecture.
It starts from spinning up a new Linux server, downloading OpenStreetMap (OSM) assets, generate an .mbtiles file and finally serving it over HTTP with TileServer GL.
If you have no idea what those words mean, don't worry, I'm gonna walk you through all of it in this blog post, so bare with me until the end!
setup the server
First thing first, before we are gonna touch anything regarding map stuff, we are gonna need a server to host it.
So look for your credit card and rent a server from your favorite VPS provider. The server specification would depend on what kind of web map that you need.
As of my needs:
- Max zoom level: 19
- Indonesia-area only
- Full road labels
Since I only need Indonesia area for the map, I don't really need a gigantic storage size for the server.
A full-world OSM map requires a significant storage, ranging from 150 GB to over 2 TB, depending on whether you are using pre-rendered vector tiles or hosting a live PostGIS database for rendering tiles yourself.
Here's my server specification:
free -h