DynamoDB中的原子计数器 [英] Atomic counters in DynamoDB

查看:709
本文介绍了DynamoDB中的原子计数器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑在我的应用程序中使用 Amazon DynamoDB ,我有一个关于其原子计数器可靠性。

I was considering to use Amazon DynamoDB in my application, and I have a question regarding its atomic counters reliability.

我正在构建一个分布式应用程序需要同时始终,增加/减少存储在Dynamo属性中的计数器。
我想知道Dynamo的原子计数器在一个重并发环境中的可靠性,并发环境中的并发级别非常高(假设例如平均速率为20k的并发命中),以获得想法每月增量/减少近52亿)。

I'm building a distributed application that needs to concurrently, and consistently, increment/decrement a counter stored in a Dynamo's attribute. I was wondering how reliable the Dynamo's atomic counter is in an heavy concurrent environment, where the concurrency level is extremely high (let's say, for example, an average rate of 20k concurrent hits - to get the idea, that would be almost 52 billions increments/decrements per month).

计数器应该是超可靠的,并且永远不会错过任何命中。有人在这种关键环境中测试DynamoDB吗?

The counter should be super-reliable and never miss a hit. Has somebody tested DynamoDB in such critical environments?

感谢

推荐答案

DynamoDB通过在多个服务器上分割密钥来获取它的缩放属性。这类似于其他分布式数据库,如Cassandra和HBase。虽然您可以增加DynamoDB的吞吐量,只是将您的数据移动到多个服务器,现在每个服务器可以处理总并发连接数/服务器数。请查看其常见问题解答,了解如何实现最大吞吐量( http://aws.amazon.com/dynamodb) / faqs /#Will_I_always_be_able_to_achieve_my_level_of_provisioned_throughput

DynamoDB gets it's scaling properties by splitting the keys across multiple servers. This is similar to how other distributed databases like Cassandra and HBase scale. While you can increase the throughput on DynamoDB that just moves your data to multiple servers and now each server can handle total concurrent connections / number of servers. Take a look at their FAQ for an explanation on how to achieve max throughput (http://aws.amazon.com/dynamodb/faqs/#Will_I_always_be_able_to_achieve_my_level_of_provisioned_throughput)

这意味着有一个键直接递增,因为该键必须位于一个服务器上。还有其他方法来处理这个问题,例如在具有对DynamoDB的刷新增量的存储器聚集中(尽管这可能具有可靠性问题)或分片计数器,其中增量分布在多个键上并通过拉取被分片的所有键来读回计数器( http://whynosql.com/scaling-distributed-counters/ )。

This means that having one key that is incremented directly will not scale since that key must live on one server. There are other ways to handle this problem, for example in memory aggregation with a flush increment to DynamoDB (though this can have reliability issues) or a sharded counter where the increments are spread over multiple keys and read back by pulling all keys in the sharded counter (http://whynosql.com/scaling-distributed-counters/).

这篇关于DynamoDB中的原子计数器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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