Why Zig is Migrating from AWS to Self-Hosted
Date: 2024-09-14 | create | tech | zig | aws | cloud | webapps | hetzner | hosting |
Zig recently announced they are migrating from AWS to self-hosted.
In this post we'll explore what they're doing, why they're doing it, and what we can learn from it.
What is Zig Migrating?
Zig is migrating ziglang.org - their official language site. This is similar to fsharp.org for F# or python.org for Python.
The official Zig site has a few primary functions:
- Providing Documentation
- Hosting Language version Downloads
- News (like the announcement post)
How was Zig Hosted on AWS?
Previously Zig hosted their externally-facing static website and version downloads using Amazon S3 + CloudFront (S3 is a static asset host, CloudFront is a CDN).
Over the years Zig's hosting costs rose from ~$10 / month in 2019 to ~$600 / month in 2024.
- 2019 - $10
- 2021 - $100
- 2023 - $500
- 2024 - $600
In 2023 Zig paid out $14k in infrastructure costs - coming out to about ~$1k per month and ~3% of their total expenses.
Why is Zig Migrating off AWS?
Zig is a relatively small language (used by just 0.9% of developers) and yet they're spending ~$1k per month to host their static assets. They seem to be projecting growth forward and coming to the conclusion that their current infra costs are untenable.
Programming language popularity is pulled from Stack Overflow's 2024 dev survey.
In the post they reference several popular languages and their ballooning usage and infrastructure costs as data for why they need to make a change now.
- Rust (11.7%) - $404k in infra costs in 2023
- Python (46.9%) - Package Storage usage has nearly doubled for the past few years
Zig's infra costs itself seem to be increasing by about 1.5-2x each year so they are trying to change that trajectory so they can spend less on infra and more on the developers / contributors pushing the language and ecosystem forward.
What is Zig Migrating to?
- Site: 36 EUR / Month server via Hetzner (probably around 4 vCPU, 16GB RAM)
- Downloads: Served via server, prefer secondary mirrors via torrent
Ziglang.org is moving to a self-hosted solution - starting with a 36 EUR / month server from Hetzner. If they need more than that they are willing to scale up to a 200 EUR / month server but say they hope to not need that.
This helps them as it caps their hosting costs per month (avoiding runaway cloud costs) while likely giving them more than enough power to serve their static website. They mention that a large portion of their costs come from sudden spikes in bandwidth - likely unintended traffic surges from malfunctioning CI processes - so this prevents the huge swings in usage (and cost).
Hetzner itself does charge for egress bandwidth so this won't be free but their egress fees will likely be much lower than AWS (current prices put Hetzner at $1 / TB and AWS at $92 / TB - so savings of about 92x).
Further - Zig is going to start distributing future releases via Torrent. This would allow people to volunteer to set up mirrors and seed these Torrents to further remove bandwidth usage from Zig.
Next
I've been closely following the trend moving from public clouds to self-hosted options. The prices are often vastly cheaper (like 10x for compute) while often providing more performance (2-4x) which can be pretty appealing.
The downside of course is more administration on your part but new tools like Coolify and Dokploy make this easier - giving you more of a PaaS feel than legacy server administration used to feel like.
I've personally been playing around with self-hosted myself and have migrated several of my sites over to a Hetzner server using Coolify as a PaaS. Early results are good achieving 10x less server costs, 100x less bandwidth costs, and 4x latency improvements. I'll be posting more about my experiences soon so stay tuned for that.
If you liked this post you might also like:
Want more like this?
The best / easiest way to support my work is by subscribing for future updates and sharing with your network.