Latest Notes

Roman Grossi • Founder

Indie hacking, startups, resilient systems - and staying sane while building a small company

Back to articles

How Not to Save Money on Cloud Storage

· 3 min read · 9 views

How not to save money

ℹ️ Warning: lots of boring 'technical' words ahead.

A few years ago on the Fullyst website I created a Telegram sticker collection with search. The collection attracts around 2,000 visitors a day. It is also a lot of static files.

I could not request stickers from the Telegram API for each visitor because I would hit the requests-per-second limits. What to do? Store them on S3, GCP Storage or some other static storage.

But:

1. It is about 300 GB of files.

2. More than 500,000 stickers are requested every week (when people browse the sticker catalog, they see stickers).

3. That is about 60 GB of outgoing traffic per week (and if you have worked with S3 or GCP Storage you know that traffic is very expensive).

At some point I chose Google Cloud Platform Storage, but for the last two months I have been suffering from high bills and finally decided to switch to something 'alternative'. Fortunately, a lot of new providers have appeared in recent months.

I went with Cloudflare R2. Cloudflare is a very popular DDoS protection service, DNS server, domain registrar and a bunch of other great tools, some of which I already use for Fullyst.

The first week went pretty well:

1. It is much cheaper than S3 and GCP Storage.

2. It is S3 API compatible.

But then... I noticed that sticker thumbnails (~64 KB) were loading in 2–3 seconds. How is that even possible? Unfortunately, for Cloudflare R2 this is considered 'normal', but for me it is completely unacceptable.

Then I remembered the new S3-compatible storage from Hetzner (a very popular data center where I have been renting three servers and two virtual servers for 10.5 (!) years).

The problem is that Hetzner Storage is in beta. How do you get into the beta? Turned out to be simple: I described my use case in detail (including number of objects, storage volume and monthly requests), and a few hours later I got beta access. I guess Hetzner is interested in feedback from customers with numbers like that.

Right now 10% of the stickers have already been migrated to Hetzner, and the story could end there. But I decided to write about money.

I need to save money, right? So I need to delete the migrated stickers from GCP Storage, right? But to delete the stickers I have to use the API and first list the objects in each directory (>250,000 directories). Then I need to send a delete request. And guess what? Those requests cost money. In my case, to delete all the stickers I would have to send more than 60,000,000 requests, and each million costs $0.50. So I will have to pay $30 just to delete stickers. I will save money in the future, but for now I still have to pay (although that is still better than paying taxes).

More to explore