Cloudflare made waves in the tech world when it announced R2, an object storage with zero egress fees.
For over a decade most devs and indie founders have used Amazon S3 for cloud storage. Those who couldn't afford S3 have used Wasabi or Backblaze. Those companies, however, have questionable pricing strategies.
We needed something cheaper that just worked. R2, which Cloudflare launched on September 2022, seemed very promising on these fronts.
Surprisngly, I haven't seen anyone do a comprehensive review on Cloudflare R2.
If you search for it on YouTube, you'll see (almost) no review. Even searching through dev.to gave me only two matches.
So I decided to dive in on my own and see if it really works as advertised.
P.S. All of the images shown in this post are hosted on Cloudflare R2. I eat my own dog food.
You can access Cloudflare R2 by going into your Cloudflare Dashboard.
If you've used Amazon S3, you'll notice a similar terminology: You can create various "buckets." You can then put your files into those buckets.
I've created an "indiehackers" bucket. After you open the bucket, you'll see an "Upload" button:
This allows you to upload files (or folders) directly from the interface:
After you upload a file, you can open it and you'll get an S3 URL and a public URL:
The public URL is exactly what it says... public. You can share those files, embed them if they're images (like I did in this post), etc.
You can choose this setting when creating a bucket. By default, Cloudflare sets your region to Automatic, meaning that it "chooses a bucket location in the closest available region to the create bucket request based on the location of the caller.".
Managing R2 as an API
Cloudflare allows you to interact with it from the terminal using Wrangler, a command-line tool for building with Cloudflare products.
For example, the command for creating a bucket is:
wrangler r2 bucket create YOUR_BUCKET_NAME
The command for uploading a file is:
wrangler r2 object put test-bucket/dataset.csv --file=dataset.csv
All of the images I uploaded loaded fast (as you can see from this post). So far, I haven't encountered any "surprising" pricing.
So I can safely say that Cloudflare R2 works as advertised.
Here's the pricing page for Cloudflare R2:
Compare this to the pricing model for S3:
Almost $0.1 per gigabyte. Sure you get the first 100GB for free, but you can very easily exceed this limit if you host large files.
Cloudflare sounds like an exciting alternative because you can launch a side project connected to files/images without being startled with a large hosting price.
This is great for serial entrepreneurs.
Let's say you start 5 side projects and hope that one of them gets traction within the next 12 months. You work on and promote all of the projects in parallel and hope that one of them will find a product-market fit.
One year later, one of your side projects takes off. With a service like Cloudflare R2, you won't end up blowing your weekly salary on an unexpected hosting bill. Instead, you can just continue launching.
I'm confused. Is R2 built upon S3?
I see you uploaded filed to R2 but got an S3 link?
Help.
Been using it for the past couple months, super great, no troubles! Especially if you use their DNS service for your domain too. Then connecting a subdomain to your bucket is one click away.
thanks for writing the review! currently exploring bunny(dot)net as alternative. Here's another list of alternative for s3 in case anyone need it https://finddev.tools/alternative-to/amazon-s3
We tried to use R2 for some time, but they had horrible problems with file propagation. We had a profile picture uploading endpoint and the profile pictures would sometimes not load for a couple of minutes after uploading. Seems like tons of other people also had this issue.
This absolutely ruined any chance of us using them.
We went with DigitalOcean spaces instead which is also quite cheap
I've been utilizing it for the last few months, and it's been fantastic, and completely trouble-free! What's especially noteworthy is their DNS service for domain management. When you combine this with their platform, connecting a subdomain to your storage bucket becomes a breeze with just a single click.
Just set it up, pretty cool how it's compatible with the S3 API/SDK, don't have to change much code and having a domain already connected and managed on Cloudflare makes the process of masking the bucket/creating a reverse proxy really easy to do, performance has been great so far as well!
Last time i check R2 it was necessary to spawn a Worker in front of your Buckets to make data available. Looks like they changed it. When the Worker was necessary you had to pay the Workers egress tho
Cloudflare R2 is solid! Enhanced security and performance.
Thanks for doing a detailed review! I was considering switching over to R2 from Backblaze because it seems much more appealing in general.
8171
This comment was deleted a year ago.