News for hackers. Stuff that matters.
Re:A New Hope for Object Storage: R2 Enters Open Beta by vlovich123 on Wednesday May 11, 2022 @10:17AM (#31340296)
I’m an engineer on the R2 team. Happy to answer any questions in this thread.
Re:A New Hope for Object Storage: R2 Enters Open Beta by ignoramous on Wednesday May 11, 2022 @11:13AM (#31341154)
1. TFA goes R2 clients will be able to enable caching (in the near future). A couple questions:

1a. Cloudflare Cache is free for users (up to 500MB per file for unlimited files), but if R2 uses it transparently, are reads from cache metered per R2 pricing? And what about the file-size limits that apply to free/pro accounts?

1b. How is strong-consistency guaranteed despite caches in front of the bucket? I guess cache-invalidation can be done through Durable Object (DO) Alarms or some such? Or, would this guarantee no longer hold?

2. TFA mentions in the passing that R2 utilizes DO (for presumably metadata / journal?). Cloudflare once wrote in detail about how DO is used in a pretty novel way to power wrangler tail, and so I was wondering if there's something novel about R2's use of DO, too?

3. In-Worker API: Are customers metered for both In-Worker API (duration and invocation) and R2 (Class A / Class B)? If so, that makes Class B operations almost twice as expensive than S3 (excluding egress).

4. Any ETA on "Public buckets"?

5. Has Cloudflare rolled out newer server designs just for R2 (aka Dropbox's MagicPocket)?

6. Is serving media content (say, audio and video) an acceptable use-case for R2?

7. Any plans for Kinesis Firehose (a managed-ingestion pipeline) esque product to front R2?

Thanks.

Re:A New Hope for Object Storage: R2 Enters Open Beta by vlovich123 on Wednesday May 11, 2022 @11:53AM (#31341745)
1a. I don't think we have anything to share with regards to the logistics of putting cache in front of R2 or how that product will work.

1b. Unavoidably as you guess you'd be giving up the consistency. Presumably the consistency guarantees would be part of the cache-control header you associate with the object. Cache purging would probably work similar & we have exciting upcoming news about major performance improvements for that. But again, since we don't have any idea of what that product looks like, hard to say.

2. There is. I have a bunch of technical blog posts written but we decided to punt on providing that detail for a few months just to give everyone some breathing room. R2 does have one important extension we got the DO team to build just for us (not 1 instance of the code instantiated). That piece will only be available for R2. R2 is also driving performance improvements & API improvements to DO that will almost certainly percolate out to external users.

3. The equivalent model would be AWS Lambda + S3 so I think we're significantly cheaper (+ Workers is faster than AWS lambda - R2 is still in open beta so not useful to compare perf against S3 yet). Yes, if you're using it to emulate public buckets, then it'll be a bit expensive (depending on egress charges you might otherwise face)

4. Soon. It's very high on our list alongside pre-signed URLs

5. Nothing to share at this time.

6. Yes. From Matthew Prince aka eastdakota [1]

7. Nothing to share at this time.

[1] https://news.ycombinator.com/item?id=28682885

Re:A New Hope for Object Storage: R2 Enters Open Beta by JonoBB on Wednesday May 11, 2022 @10:54AM (#31340844)
If I remember correctly, there was some discussion around R2 acting as a proxy in front of s3. So, if R2 does not yet have the asset, you would automatically pull it in from S3, and from then on R2 would serve it directly.

Is that still on the cards?

Re:A New Hope for Object Storage: R2 Enters Open Beta by greg-m on Wednesday May 11, 2022 @11:05AM (#31341028)
Yes, still in the cards. Hoping to release this before GA - it'll be a part of our migrator.
Re:A New Hope for Object Storage: R2 Enters Open Beta by ignoramous on Wednesday May 11, 2022 @11:03AM (#31341008)
Not a Cloudflare employee, but: Yep, Cache Reserve is in private beta https://blog.cloudflare.com/introducing-cache-reserve/
Re:A New Hope for Object Storage: R2 Enters Open Beta by vlovich123 on Thursday May 12, 2022 @09:01AM (#31353483)
Cache reserve is a similar concept but a bit of a different product (although some people might be happy with the no-code approach that enables). Migration is a bit of a different thing.
Re:A New Hope for Object Storage: R2 Enters Open Beta by ianopolous on Wednesday May 11, 2022 @06:44PM (#31346910)
Thanks for the awesome product! I have a few questions:

1. Are the rate limits for all users on a given bucket, or by source IP as some other providers do?

2. What is the plan for the rate limits post beta?

3. Do you support the x-amz-content-sha256 header. i.e. If a put contains that header and the content hash doesn't match is it rejected?

4. What does it mean to support pre-signed URLs? Can't a client pre-sign a URL that anyone else can use? My understanding is they are the same as normal usage from the server's perspective, just the key holder signs the request, and the other person actually makes the request.

5. Why is the read limit smaller than the write limit?

Re:A New Hope for Object Storage: R2 Enters Open Beta by taylor12345 on Wednesday May 11, 2022 @11:46PM (#31349050)
I'm also an engineer on R2 team.

1 & 2 - We're reserving some ability to rate-limit during beta as we figure out how best to scale our systems under load. I'll defer to vlovich & greg-m for post-beta plans.

3. We do support that header. Mismatching content hashes will be rejected during write. If you ever experience otherwise, please report it.

4. We only support sigv4 auth via header currently: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-u...

With presigned urls, we will support sigv4 in url parameters https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-...

5. See #1. We'll be improving the throughput of both operations, but currently reads have higher throughput than writes.

Re:A New Hope for Object Storage: R2 Enters Open Beta by ianopolous on Thursday May 12, 2022 @03:15AM (#31350272)
Thank you, that makes sense.

So presigned URLs that use auth header are fine (We use those extensively in Peergos, as presigned with an auth query parameter isn't cached by browsers as the query string will change with subsequent requests).

Re:A New Hope for Object Storage: R2 Enters Open Beta by InvaderFizz on Thursday May 12, 2022 @01:00AM (#31349473)
On the subject of sigv4, are you going to allow longer than 7 day lifetimes for presigned URLs?
Re:A New Hope for Object Storage: R2 Enters Open Beta by brenogazzola on Wednesday May 11, 2022 @11:04AM (#31341019)
Any advice/guides on how to get this working with Rails ActiveStorage?
Re:A New Hope for Object Storage: R2 Enters Open Beta by vlovich123 on Wednesday May 11, 2022 @11:12AM (#31341145)
Should be the same as any other S3 backend. We don’t have examples for ActiveStorage per se but we have boto3, AWS JS SDK, and rclone [1].

[1] https://developers.cloudflare.com/r2/platform/s3-compatibili...

Re:A New Hope for Object Storage: R2 Enters Open Beta by ehutch79 on Wednesday May 11, 2022 @02:53PM (#31344218)
Does the worker api support multipart uploads?
Re:A New Hope for Object Storage: R2 Enters Open Beta by taylor12345 on Wednesday May 11, 2022 @11:35PM (#31348997)
Not yet. The current in-worker api is described at https://github.com/cloudflare/workers-types/blob/master/inde...