使用 AWS Kinesis 上传大文件

Using AWS Kinesis for large file uploads

我的客户有一项服务可以存储很多文件,例如视频或声音文件。该服务运行良好,但看起来长时间存储文件是一个很大的挑战,我们希望使用 AWS 来存储这些文件。

问题如下,客户想使用AWS kinesis将我们服务器上的每个文件传输到AWS。这可能吗?我们可以使用该服务传输文件吗?有很多视频文件,而且我们每天都收到越来越多的视频文件。而且每个文件都比较大。

我们还想保存文件的一些细节,可能保存到 dynamoDB 中,我们可以为此使用 Lambda 函数。

最重要的是,我们需要一个可靠的数据传输选项。

KInesis 不是上传文件的正确工具,除非它们都非常小——而且大多数视频几乎肯定会超过 1MB 的记录大小限制:

The maximum size of a data blob (the data payload before Base64-encoding) within one record is 1 megabyte (MB).

https://aws.amazon.com/kinesis/streams/faqs/

通过其中一个 SDK 将 S3 与分段上传结合使用。可以将 90 多天都不会访问的对象移至 Glacier。

Multipart upload allows you to upload a single object as a set of parts. Each part is a contiguous portion of the object's data. You can upload these object parts independently and in any order. If transmission of any part fails, you can retransmit that part without affecting other parts. After all parts of your object are uploaded, Amazon S3 assembles these parts and creates the object. In general, when your object size reaches 100 MB, you should consider using multipart uploads instead of uploading the object in a single operation.

亚马逊网络服务。亚马逊简单存储服务 (S3) 开发人员指南(Kindle 位置 4302-4306)。 Amazon Web Services, Inc.. Kindle 版。

要进一步优化文件上传速度,请使用传输加速:

Amazon S3 Transfer Acceleration enables fast, easy, and secure transfers of files over long distances between your client and an S3 bucket. Transfer Acceleration takes advantage of Amazon CloudFront’s globally distributed edge locations. As the data arrives at an edge location, data is routed to Amazon S3 over an optimized network path.

亚马逊网络服务。亚马逊简单存储服务 (S3) 开发人员指南(Kindle 位置 2060-2062)。 Amazon Web Services, Inc.. Kindle 版。

Kinesis 推出了一项新服务 "Kinesis Video Streams" - https://aws.amazon.com/kinesis/video-streams/ 这可能有助于移动大量数据。