避免油门 dynamoDB [英] Avoid throttle dynamoDB

查看:12
本文介绍了避免油门 dynamoDB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是云计算的新手,但有一个问题,我将要描述的机制是否存在或可能创建?

I am new to cloud computing, but had a question if a mechanism as what I am about to describe exists or is possible to create?

Dynamodb 已配置吞吐量(例如 100 次写入/秒).当然,在现实世界的应用程序中,现实生活中的吞吐量是非常动态的,几乎永远不会是您预置的 100 次写入/秒.我在想 dynamodb 的某种类型的队列会很棒.例如,我的 dynamodb 在高峰时段每秒可能会收到 500 个写入请求(我分配的 5 倍)并且会返回错误.我可以在客户端和数据库之间放置一些队列吗,所以客户端请求进入队列,客户端得到确认他们的请求已被处理,然后队列以 100 的速率向 dynamodb 发出请求/每秒准确写入,这样就不会返回错误并且我不需要提高吞吐量,这会增加我的成本?

Dynamodb has provisioned throughput (eg. 100 writes/second). Of course, in real world application real life throughput is very dynamic and will almost never be your provisioned amount of 100 writes/second. I was thinking what would be great would be some type of queue for dynamodb. For example, my dynamodb during peak hours may receive 500 write requests per second (5 times what I have allocated) and would return errors. Is it there some queue I can put in between the client and database, so the client requests go to the queue, the client gets acknowledged their request has been dealt with, then the queue spits out the request to the dynamodb at a rate of 100/ writes per second exactly, so that way there are no error returned and I don't need to raise the through put which will raise my costs?

推荐答案

将 AWS SQS 放在 DynamoDB 的前面会为您解决这个问题,这不是一个不常见的设计模式.SQS 已经非常适合根据需要进行扩展,并且可以接收大量具有不可预测的流模式的消息.

Putting AWS SQS is front of DynamoDB would solve this problem for you, and is not an uncommon design pattern. SQS is already well suited to scale as big as it needs to, and ingest a large amount of messages with unpredictable flow patterns.

您可以先将所有消息放入 SQS,也可以在超过 DynamoDB 数据库的设计吞吐量时使用 SQS 作为溢出缓冲区.

You could either put all the messages into SQS first, or use SQS as an overflow buffer when you exceed the design thoughput on your DynamoDB database.

一个或多个工作实例可以从 SQS 队列中读取消息,并按照您决定的速度将它们放入 DynamoDB.

One or more worker instances can than read messages from the SQS queue and put them into DynamoDB at exactly the the pace you decide.

如果传入消息的顺序非常重要,Kinesis 是您提取传入消息然后将它们插入到 DynamoDB 中的另一种选择,按照它们到达的相同顺序,按照您定义的速度.

If the order of the messages coming in is extremely important, Kinesis is another option for you to ingest the incoming messages and then insert them into DynamoDB, in the same order they arrived, at a pace you define.

IMO,SQS 将更易于使用,但如果您的需求更复杂,Kineses 将为您提供更大的灵活性.

IMO, SQS will be easier to work with, but Kineses will give you more flexibility if your needs are more complicated.

这篇关于避免油门 dynamoDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆