在AWS中挑选数据存储类型



如果在现有的内部部署应用程序中不应更改代码,您会选择什么进行数据存储,S3还是EBS?

来自亚马逊提供的文档。亚马逊s3:

Amazon S3 has a simple web services interface that you can use to store 
and retrieve any amount of data, at any time, from anywhere on the web.
It gives any developer access to the same highly scalable, reliable, 
fast, inexpensive data storage infrastructure that Amazon uses to run 
its own global network of web sites. The service aims to maximize 
benefits of scale and to pass those benefits on to developers. 

亚马逊EBS:

Amazon Elastic Block Store (Amazon EBS) provides persistent block 
storage volumes for use with Amazon EC2 instances in the AWS Cloud. 
Each Amazon EBS volume is automatically replicated within its 
Availability Zone to protect you from component failure, offering high 
availability and durability. Amazon EBS volumes offer the consistent 
and low-latency performance needed to run your workloads. With Amazon 
EBS, you can scale your usage up or down within minutes – all while 
paying a low price for only what you provision.

EBS的文档形式很清楚,它只能由EC2实例使用。例如我在我的EC2实例上和我的应用程序一起托管了一个数据库,这种情况下的风险是,如果我的服务器宕机,我的所有数据都会随之丢失。我不会使用亚马逊的托管数据库,如RDS、Dynamo、CloudDB(成本可能是一个因素),也不会使用带复制的数据库(多个实例的成本可能是个因素),我将这个EBS装载为一个目录,并将这个目录作为我的数据库的数据文件夹。

如果我的EC2实例失败,我将分离这个EBS并连接到另一个服务器,我的所有数据将再次可用。

注意:您也可以定期拍摄EBS的快照,作为安全保障。

另一方面,s3就像一个平面文件系统,其工作方式类似于CDN。AmazonS3的基本存储单元是被组织成桶的对象。每个对象都由一个用户指定的唯一密钥标识。

AmazonS3是一个能够存储非常大的对象的对象存储器,大小高达5TB。S3通常用于存储图像、视频、日志和其他类型的文件。S3存储桶中可以存储的对象数量没有限制。S3中的每个对象都有一个url,可以用来下载该对象。S3中的对象也可以通过Amazon Cloudfront CDN(内容交付网络)进行交付。S3中的对象可以存档到Amazon Glacier,这是一种非常便宜的存档服务。

  • S3是一个对象存储,所以没有
  • EBS是一个区块存储,所以是的

但是,如果您正在寻找以S3为代价装载到EC2实例的大型存储,您可以考虑使用"AWS存储网关"https://aws.amazon.com/storagegateway/

最新更新