gpt4 book ai didi

azure - 全局递增计数器有哪些选项?

转载 作者:行者123 更新时间:2023-12-03 00:35:16 25 4
gpt4 key购买 nike

我正在构建一个可以从全局递增计数器中受益的系统。基本上,这是一种递增计数器并返回值的服务。我尝试过 Azure Page Blobs(计数器增量 header )、Redis (INCR) 和 SQL Server (Identity)。它们都可以工作,但前两个相当慢,通常需要一秒的时间才能生成 2000-3000 个数字。 SQL Server 速度要快得多,但只有在连接打开后才可以。

Azure、AWS 或软件(例如 redis)中还有哪些其他选项?有没有特别擅长这方面的服务?

最佳答案

您可以使用AWS DynamoDB Atomic Counters实现全局计数器。

You can use the UpdateItem operation to implement an atomic counter—a numeric attribute that is incremented, unconditionally, without interfering with other write requests. (All write requests are applied in the order in which they were received.) With an atomic counter, the updates are not idempotent. In other words, the numeric value will increment each time you call UpdateItem.

这允许构建一个可靠的计数器,您可以根据您的规模调整吞吐量(启用自动缩放),并且还可以通过最近推出的 Global Tables 在全局范围内进行复制(可选)提供快速的本地读写性能。

Global Tables builds upon DynamoDB’s global footprint to provide you with a fully managed, multi-region, and multi-master database that provides fast, local, read and write performance for massively scaled, global applications. Global Tables replicates your Amazon DynamoDB tables automatically across your choice of AWS regions.

关于azure - 全局递增计数器有哪些选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47686102/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com