简体   繁体   English

使用 AWS S3 存储桶作为 NoSql 解决方案

[英]Using AWS S3 Bucket as a NoSql Solution

We have an application that makes an API request and then stores the xml response in an RDS MySql Database.我们有一个应用程序发出 API 请求,然后将 xml 响应存储在 RDS MySql 数据库中。

These xml responses are huge, and are taking up too much RDS storage.这些 xml 响应很大,占用了太多 RDS 存储。 I understand it's possible to store these instead in an S3 Bucket, since it is a key/value store much like DynamoDb.我知道可以将这些存储在 S3 存储桶中,因为它是一个非常类似于 DynamoDb 的键/值存储。

Does anyone have any experience doing this in PHP?有没有人在 PHP 中有这样做的经验?

The requirements would be that our application should have no issue writing 1000s of S3 entries per minute.要求是我们的应用程序每分钟写入 1000 条 S3 条目应该没有问题。 We would also need to be able to retrieve an entry from S3 in realtime, just like we would if we were doing a mysql query for the xml response (which we currently do now).我们还需要能够实时从 S3 检索条目,就像我们对 xml 响应(我们现在正在执行)执行 mysql 查询一样。

RDS is for relational data where you want to be able to query using complex SQL queries (Joins, Filters etc.) RDS 适用于您希望能够使用复杂的 SQL 查询(联接、过滤器等)进行查询的关系数据

S3 is for static(ish) file storage & serving, without filtering. S3 用于静态(ish)文件存储和服务,无需过滤。 You get back the whole file (not part of it) at a time.您一次取回整个文件(不是其中的一部分)。

You can probably shoehorn both of them into doing what you want, but you'd be best off choosing the one that fits the type of read/write/access type that you require.您可能可以硬着头皮做您想做的事,但最好选择适合您需要的读/写/访问类型的那个。

If you want to serve files like you describe in your question you're probably best off with S3.如果您想提供您在问题中描述的文件,您可能最好使用 S3。 You can use their official SDK for PHP to handle the downloads and uploads.您可以使用他们的官方 SDK for PHP来处理下载和上传。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM