S3-Compatible Cloud Storage Costs
S3 is a convenient way to host larger static artifacts for a website, but which S3-compatible service is the cheapest for that usecase?
Monthly Cost Calculator
R2 comes out significantly ahead in nearly every practical usage due to its overly generous free tier and zero egress cost. However, Cloudflare lacks a way to set a spending limit, so it would be possible for an abusive user to repeatedly fetch the same content and leave you with an unexpected bill. The free tier is very generous, and the 10 million requests per month is 3.85 QPS for a month. But in the context of abuse, that could turn into real money quite quickly.
As a result, for this specific usecase of offering files and static assets for a personal blog, I’ve opted to go with Backblaze B2, which does offer a way to set a spending limit. Egress fees are not charged within the "Bandwidth Alliance", which includes Cloudflare’s CDN. So if you put Cloudflare in front of serving content from your B2 bucket, then there’s no egress charges, and without the egress charge, B2 seems acceptable in terms of price. I’m happy to accept any ~$1 charge from Backblaze as an "insurance fee" against an unexpected large bill from R2.
Note that the major difference here, versus most other price comparisons, is that egress is to the general internet due to using the S3-compatible offering as a general file host, and thus the most penalizing egress rules from each service are applied.
Any service which has a fixed minimum (DigitalOcean, Linode, etc.) was removed from consideration as the fixed cost would dwarf any other per-request or per-GB storage cost for small data volumes (and my whole motivation for this post was to investigate small data volumes).
Azure Blob Storage’s egress calculations are complicated.
Backblaze B2 offers 2,500 API calls free per day. Assuming reads are well distributed this is 750,000 free reads per month. However, reads are probably not well distributed, so this is likely generous to B2.
Backblaze B2 offers free egress up until 3x of your stored data, except I didn’t have a way to represent that in my data model, so that free egress isn’t accounted for.
OVHcloud charges in 1GB increments, which isn’t reflected in the cost computation.
Scaleway charges in euro, and thus I used the current 1 EUR = ~1.09 USD conversion.
See discussion of this page on Reddit, HN, and lobsters.