orleans icon indicating copy to clipboard operation
orleans copied to clipboard

AWS S3 Storage Provider

Open seniorquico opened this issue 7 months ago • 4 comments

AWS S3 now supports conditional writes using the If-None-Match and If-Match + ETag request headers:

https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html

As a looong follow-up to #6428... I'd be happy to prototype, test, and contribute an implementation. Is there interest in a PR to the core repo, or would this be better as an OrleansContrib package?

seniorquico avatar Apr 17 '25 15:04 seniorquico

I am interested in this and having it in the core repo as long as we have an emulator for it in GitHub Actions. My understanding is that S3 doesn't let you overwrite an existing blob yet. Do you have ideas on how to implement updates?

ReubenBond avatar Apr 18 '25 03:04 ReubenBond

I am not aware of any issues with overwriting/updating blobs- but maybe there are some assumptions to lay out? I'm thinking of an implementation with a single PutObject call, not multi-part uploads. The docs seem to indicate multi-part uploads support conditional writes, as well. I don't have any experience with it, though. A single PutObject call would limit the total size of the grain state. I have to admit, it's not a concern for our specific use case. If this disqualifies it for contributing to core, I would understand.

A few years ago, AWS introduced strong read-after-write consistency. (That was another challenge with trying to use it as a storage provider.) That, combined with the conditional writes, I believe S3 is viable as a storage provider? I threw together this quick gist to test the conditional write behavior simulating concurrent writes based on ETags:

https://gist.github.com/seniorquico/e6e2d7616b599846d1f177a6f9782192

It's (obviously) not a high performance test to force race conditions server-side. That said, I tested with AWS S3, Cloudflare R2, and Min.io, and it worked as expected. (Cloudflare R2 and Min.io supported conditional writes before AWS S3.)

I'll have to do some research into emulator options for GitHub Actions and whether or not any support the conditional write behaviors.

seniorquico avatar Apr 19 '25 01:04 seniorquico

Ok, this is great - I was mistaken. I see the updated docs on the behavior here: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html

ReubenBond avatar Apr 19 '25 01:04 ReubenBond

FYI- We have an internal prototype, and we're planning out integration and load tests. We'll share a PR for feedback when we're confident in the approach.

seniorquico avatar Apr 25 '25 16:04 seniorquico

@seniorquico any progress since April?

corstian avatar Nov 05 '25 21:11 corstian

@corstian Yes! We have multiple Orleans apps/clusters running. We ended up starting with an older Orleans v3 cluster, and the AWS provider has been running in production at-scale for a few months. There are some (minor) technical differences between the v3 and v9 providers. We didn't get a chance to dedicate time to the v9 port yet.

@ReubenBond Interest in a PR for v3? We could iterate from there to get the v9 implementation?

seniorquico avatar Nov 06 '25 18:11 seniorquico

@seniorquico yes, sure thing. I will help to review it and get it over the line.

ReubenBond avatar Nov 07 '25 01:11 ReubenBond