Reputation:
Can any one tell me the difference b/w Transfer Manger to copy and copyObject
function of S3 Client in S3(java sdk)?
Upvotes: 3
Views: 1365
Reputation: 670
I don't agree with the old accepted answer. You can use single S3 client too for different tasks. Both under the hood make an HTTP call. So it doesn't make any sense saying that it is '1' connection.
I can not find anything official in AWS docs suggesting transferManager is more efficient. In fact, if you drill down into the transferManager's docs and code (Page 406), it is nothing but an abstraction to Amazon S3 copyObject.
The key difference is that transferManager copy is Async. The Copy object returned by the S3TransferManager's copy method represents the copy process. After the copy process completes, the CompletedCopy object contains details about the response. You can make S3 copyObject async too by native Java methods (or your programming language).
Transfer Manager just hides the complexity such as maintaining thread pool, waiting for result, changing copy algorithm etc. and provides an easy-to-use interface. It also switches the algorithm between copy and part-copy depending on your file size. As far as efficiency and greater degree of control goes, it does not provide any additional benefit.
Upvotes: 2
Reputation: 94
The Difference b/w transfer manager and Copy Object of s3 client is that you can use a single transfer manager for different tasks On the other hand Copy Object of s3 Client makes a different approach or you can say makes new connection every time you copy from one bucket to another.
Which is efficient ? OffCourse Transfer Manager as you can reuse your manager for different operations.
Upvotes: 2