1,249 karma · joined August 14, 2015
personal website: https://hyperknot.com/
email: zsolt@maphub.net
And the risk of this project is largely mitigated by offering the full repo as open-source, so you can always self host this if needed.
- MBTiles - an SQLite file, each file is a row in a table, you need a server to serve it.
- PMTiles - a single file, optimised for serverless usage.
- Extract them into a directory, which in practice should be on a partition image. This is the approach I choose.
I tested ext4 and Btrfs and I choose Btrfs. The reason is how ext4 and Btrfs handles inodes. Btrfs handles inodes so much better compared to ext4, it doesn't allocate them at start and also allows putting tiny files right with the metadata.
Because here the average tile size is only 405 bytes, most of the tiles can actually stored with the Btrfs metadata block. From the latest run:
Btrfs data is 51.57GiB
Btrfs metadata is 84.37GiB
In summary, on a cold start (so now when it's on HN it might be totally meaningless), the following page loads in like 8-10 sec for me: https://pmtiles.io/?url=https%3A%2F%2Fdata.source.coop%2Fpro...
Technically why it's slow is entirely on CloudFlare, so I can only guess. But probably they are not mirroring files of this size across their datacenters / servers. I don't know how their public buckets hosting is done, but it's definitely very slow.
OpenFreeMap on the other hand seems almost instant for me.
Also thanks for the donation!
I believe Hetzner should not have any problem with using 100 mbps out of the 1 Gbps on their servers. That's 30 TB/month for free, per server. It'd be $300-$1800 per month on Bunny.
Basically Protomaps / PMTiles allows you to do this serverless, but it has it's downsides.
There are two ways to use PMTiles with Cloudflare:
- Putting the file in a public bucket and use HTTP range requests.
- Deploy a worker to access it.
For the range request version, you can test PMTiles here: https://pmtiles.io/?url=https%3A%2F%2Fdata.source.coop%2Fpro....
It loads in 8-10 sec for me on a cold start. Of course it gets faster if many of us try to request it at the same time, but if you check it once per day for example, it'll be really slow, up to 10 sec.
Compare that with OpenFreeMap here: https://openfreemap.org/quick_start
It's near instant for me. (I know it's not full screen but you can make the app and then see how it's in full screen).
For the Cloudflare Workers version, I didn't find any publicly available full planet test, so I don't know the performance, but Workers are not free. It might not matter for a small project, but the $0.30/million requests per month can easily add up if your project gets popular.
In terms of OpenFreeMap, hosting it on a Cloudflare Worker would be prohibitively expensive.
I don't think this project will ever make $2k per month. TBH, I'd be happy it it ever reaches $200 per month. I have to be very careful about what hosting providers to use and CDNs are out of the question.
Making this automatic might not be easy, but I might do it one day, it might help with the donations.
Just today I did my biggest feature launch so far, adding real-time collaboration, which might even be a first for map platforms: [1]
Originally I launched MapHub here in 2016 as a Show HN. Ever since I've been running it without any kind of monetization. I'm planning to launch it out-of-beta next month and add freemium packages. Feedback welcome!
[1] https://maphub.medium.com/real-time-collaborative-maps-on-ma...
[1] https://wiki.panotools.org/Panorama_formats#Cubic [2] https://en.wikipedia.org/wiki/Cave_automatic_virtual_environ...
I tried creating a PR for SublimeText's Anaconda plugin, and realised that right now it requires 4(!) separate subprocess calls, each of which starts a Python process to simply get the path of the current project's virtualenv. Until there is a very simple way (a max. 10-20 line function) to calculate this path, including a reference implementation in Python and JS, there is no way widespread editor support can happen.
https://github.com/pypa/pipfile/issues/88 https://github.com/pypa/pipenv/issues/985 https://github.com/DamnWidget/anaconda/issues/717 https://github.com/DamnWidget/anaconda/pull/720