dynamodb表结构_亚马逊DynamoDB的体系结构及其性能为何如此之高

2022-04-08 00:00:00 数据 令牌 机器 计算机 我们可以

dynamodb表结构

DynamoDB is a NoSQL database provided by Amazon Web Service (AWS). It can provide extremely high performance, more than 10 trillion requests per day with peaks greater than 20 million requests per second, and can support virtually any size with horizontal scaling. It is not uncommon for DynamoDB to serve over petabytes of data.

DynamoDB是Amazon Web Service(AWS)提供的NoSQL数据库。 它可以提供极高的性能,每天超过10万亿个请求,峰值超过每秒2000万个请求,并且可以通过水平扩展几乎支持任何规模。 DynamoDB服务超过PB数据的情况并不少见。

In this article, we will start with a brief introduction to the APIs of the DynamoDB. We will then look into the architecture of DynamoDB and explain in detail why DynamoDB can provide such high performance.

在本文中,我们将简要介绍DynamoDB的API。 然后,我们将研究DynamoDB的体系结构,并详细解释DynamoDB为什么可以提供如此高性能。

From a 10,000 feet view, DynamoDB is basically a key-value store. It can be thought as a hash-map backed by some persistent storage. Two most important operations supported by DynamoDB are Get and Put.

从10,000英尺的角度来看,DynamoDB本质上是键值存储。 可以将其视为由某些持久性存储支持的哈希映射。 DynamoDB支持的两个重要的操作是Get和Put。

Unsurprisingly, the semantics of Get and Put operations are consistent with our understanding of hash-map or key-value store. For instance, we can use Put operation to persists a key-value pair to the DynamoDB and a subsequent Get operation will return the value we stored previously.

毫不奇怪,Get和Put操作的语义与我们对哈希映射或键值存储的理解是一致的。 例如,我们可以使用Put操作将键值对持久化到DynamoDB,随后的Get操作将返回我们先前存储的值。

Put(“key”, “value”);

Put(“键”,“值”);

Get(“Key”) → Returns “value”

Get(“键”)→返回“值”

What differentiates DynamoDB is its extremely high performance. In the next sections, we will closely examine the architecture of DynamoDB and understand why DynamoDB is so scalable.

DynamoDB的与众不同之处在于其极高的性能。 在下一部分中,我们将仔细检查DynamoDB的体系结构,并了解DynamoDB为什么如此可伸缩。

  • Partitioning

    分区

To achieve horizontal scaling, DynamoDB assigns data to different partitions which are hosted by distinct machines. When there are more data, DynamoDB can create more partitions and use more machines to host those additional partitions. It works as following.

为了实现水平扩展,DynamoDB将数据分配给由不同机器托管的不同分区。 当有更多数据时,DynamoDB可以创建更多分区,并使用更多计算机来托管这些其他分区。 它的工作方式如下。

DynamoDB uses a cluster of machines and each machine is responsible for storing a portion of the data in its local disks. When a machine is added to the DynamoDB machine cluster, it is randomly assigned an integer value, which we call token in our article. In our example, we assume the DynamoDB has 3 machines. A is assigned a token of 100, B 2000 and C 10,000.

DynamoDB使用机器集群,每台机器负责将部分数据存储在其本地磁盘中。 将计算机添加到DynamoDB计算机群集时,会为它随机分配一个整数值,在本文中我们将其称为令牌。 在我们的示例中,我们假设DynamoDB具有3台计算机。 给A分配了代币100,B 2000和C 10,000。

相关文章