重命名AWS S3存储桶中的文件夹的成本 [英] Cost of renaming a folder in AWS S3 bucket
问题描述
我想重命名S3存储桶中的文件夹,我知道重命名将运行一个PUT请求,每1000个请求的成本为1美分.
I want to rename a folder in S3 bucket, I understand that rename will run a PUT request which costs 1 cent per 1000 request.
但是,PUT请求被定义为COPY,并且还涉及GET
However, the PUT request is defined as a COPY and involves with also a GET
我的问题是,当我们在S3存储桶中重命名文件夹时,是否涉及将所有子文件夹和文件复制到具有我想要的名称(费用超过1个PUT请求)的新文件夹中,或者仅仅是1 PUT请求更改名称而不触摸文件夹内的所有项目.
My question is, when we rename a folder in S3 bucket, does it involve copying all sub-folders and files to a new folder with the name I want (which costs more than 1 PUT request), or it just simply 1 PUT request to change the name without touching all the items within the folder.
推荐答案
如果您错过了它……S3中没有文件夹.
In case you've missed it... there are no folders in S3.
对象/pics/funny/cat.jpg
是不是的文件,而在另一个名为pics
的文件夹中的funny
文件夹中的cat.jpg
文件.
The object /pics/funny/cat.jpg
is not a file called cat.jpg
inside a folder called funny
inside another folder called pics
.
实际上,它是一个具有18个字符的名称的文件:pics/funny/cat.jpg
.控制台中显示的层次结构在很大程度上是为了方便人使用,并且在控制台中创建新文件夹的能力也是一种幻想.
In fact, it is a file with an 18-character name: pics/funny/cat.jpg
. The hierarchy shown in the console is largely for human convenience, and the ability to create new folders in the console is an illusion, also.
因此,是的,重命名文件夹"实际上意味着在文件夹"中为每个对象创建一个新副本,并更改对象名称以使其看起来像在路径中一样.
So, yes, renaming a "folder" actually means making a new copy of each object in the "folder," with a change to the object names to look like their are in the path.
这可以通过PUT/COPY
请求(每1000个$ 0.005,取决于区域)来完成,然后再执行旧对象的DELETE
请求(免费).没有相应的GET
请求,因为PUT/COPY
是S3内部的原子操作,因此可以避免实际下载和重新上传数据.
This can be done with a PUT/COPY
request ($0.005 per 1000 depending on the region) followed by a DELETE
request of the old object (free). There is no corresponding GET
request, because PUT/COPY
is an atomic operation inside S3, so actually downloading and re-uploading the data is avoided.
这篇关于重命名AWS S3存储桶中的文件夹的成本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!