问题描述
我是DynamoDB的新手,我很难理解预置吞吐量。
I am new to DynamoDB and I'm having trouble getting my head around the Provisioned Throughput.
据我看来,您可以使用它来一次设置读写限制。我错了吗?
From what I've read it seems you can use this to set the limit of reads and writes at one time. Have I got that wrong?
基本上我想做的是存储通过我的软件发送的电子邮件。我目前将它们存储在MySQL数据库中,但是数据量非常大,这就是为什么我要查看DynamoDB的原因。该数据我不需要经常访问,但是在需要时,我需要能够访问。
Basically what I want to do is store emails that are sent through my software. I currently store them in a MySQL database but the amount of data is very large which is why I am looking at DynamoDB. This data I do not need to access very often but when it's needed, I need to be able to access it.
上个月发送了142,925封电子邮件,每个行我将它们存储在MySQL表中的电子邮件(或电子邮件)约为2.5KB。
Last month 142,925 emails were sent and each "row" (or email) in the MySQL table I store them in is around 2.5KB.
有时会发送1封电子邮件,有时可能一次发送3,000封。没有办法知道在任何给定时间何时或多少次发送。
Sometimes 1 email is sent, other times there might be 3,000 at one time. There's no way of knowing when or how many will be sent at any given time.
您对我的吞吐量应该有什么建议吗?
Do you have any suggestions on what my Throughputs should be?
如果我确实过去了,我是否理解亚马逊会限制它并随着时间的推移添加它们是否正确?还是只是抛出错误而已,这就是结局?
And if I did go over, am I correct in understanding that Amazon throttles it and adds them over time? Or does it just throw and error and that's the end of it?
非常感谢您的帮助。
推荐答案
我正在将DynamoDB与Java SDK结合使用。当您发生访问突发时,亚马逊首先尝试保持同步,甚至允许超出预配置的吞吐量,之后它开始节流并引发异常。在我们的代码中,我们使用此错误将请求分成较小的批处理,有时会强制睡眠以使其冷却一些。
I'm using DynamoDB with the Java SDK. When you have an access burst, amazon first tries to keep up, even allowing a bit above the provisioned throughput, after that it start throttling and also throws exceptions. In our code we use this error to break the requests into smaller batches and sometimes force a sleep to cool it down a bit.
在处理您的情况时,它实际上取决于您需要不时进行的训练类型。您需要多少时间从表中获取所有数据?您真的需要全部吗?在我看来,每月〜100k对于MySQL来说听起来并不算太多。这完全取决于您所需的查询能力。
When dealing with your situation it really depends on the type of crunching you need to do "from time to time". How much time do you need to get all the data from the table? do you really need to get all of it? And ~100k a month doesn't sound too much for MySQL in my mind.. it all depends on the querying power you need.
另外请注意,在DynamoDB中,写操作是比读操作更昂贵,因此也许仅表示它不是最适合写密集型问题的信号。
Also note that in DynamoDB writes are more expensive than reads so maybe that alone signals that it is not the best fit for your write-intensive problem.
这篇关于Amazon DynamoDB和预置吞吐量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!