pplu / aws-sdk-perl

A community AWS SDK for Perl Programmers
Other
169 stars 94 forks source link

S3 automultipart thing? #90

Open frioux opened 8 years ago

frioux commented 8 years ago

Sorry I can't word. Would you be interested in a patch that would give the user a method to call, let's call it "upload" for this ticket, which uses an S3 PUT for small enough objects and multipart for large enough objects? I don't know enough about the details of the S3 API but my gut tells me that these are the important details:

I wouldn't mind writing the guts of this (the detector and the chunker, presumably with up to 3 diff apis, one autochunking, one giving the user a callback, and another on top that just does a file upload) but I suspect you may have opinions on how to make it meld best with the API, so any guidance on that would be very welcome.

pplu commented 8 years ago

Hi!

I'd be very open to getting, the behaviour that you describe :smile:

One thing I think would be nice is the Body (of PutObject, or of GetObject) to be able to be a file descriptor, so that way everything doesn't have to be in memory.

I think a PUT can be relatively big for S3. It's nice that the chunk size would be configurable (so the user can prefer more chunks with more price, or less chunks with more risk).

but I suspect you may have opinions on how to make it meld best with the API, so any guidance on that would be very welcome

I prefer to have the guts contributed, and later we'll find how to refactor it :smile: After all, the guts are the hard part :laughing:. Please start off on a branch from todays' masters (best known working S3).

Thanks for getting in touch, and contributing :)

frioux commented 8 years ago

Good call re the file descriptor. I was thinking about a coderef based version but an fd is probably better. I'll get something contributed soon; thanks for being willing!

frioux commented 8 years ago

Progress is here, in case I vanish or something before submitting a PR: https://github.com/ZipRecruiter/aws-sdk-perl/tree/auto-multipart