Criar uma tabela do DynamoDB com um throughput a quente mais alto
É possível ajustar os valores de throughput a quente ao criar sua tabela do DynamoDB seguindo as etapas abaixo. Essas etapas também se aplicam ao criar uma tabela global ou um índice secundário.
Para criar uma tabela do DynamoDB e ajustar os valores de throughput a quente por meio do console:
Faça login no AWS Management Console e abra o console do DynamoDB em https://console.aws.amazon.com/dynamodb/
. -
Selecione Criar tabela.
-
Escolha o Nome da tabela, a Chave de partição e a Chave de classificação (opcional).
-
Em Configurações da tabela, selecione Personalizar configurações.
-
No campo Throughput a quente, escolha Aumentar throughput a quente.
-
Ajuste as unidades de leitura por segundo e unidades de gravação por segundo. Essas duas configurações definem o throughput máximo que sua tabela pode processar instantaneamente.
-
Continue adicionando os detalhes restantes da tabela e selecione Criar tabela.
O exemplo da AWS CLI a seguir mostra como criar uma tabela do DynamoDB com valores personalizados de throughput a quente.
-
Execute a operação
create-tablepara criar a tabela do DynamoDB a seguir.aws dynamodb create-table \ --table-name GameScores \ --attribute-definitions AttributeName=UserId,AttributeType=S \ AttributeName=GameTitle,AttributeType=S \ AttributeName=TopScore,AttributeType=N \ --key-schema AttributeName=UserId,KeyType=HASH \ AttributeName=GameTitle,KeyType=RANGE \ --provisioned-throughput ReadCapacityUnits=20,WriteCapacityUnits=10 \ --global-secondary-indexes \ "[ { \"IndexName\": \"GameTitleIndex\", \"KeySchema\": [{\"AttributeName\":\"GameTitle\",\"KeyType\":\"HASH\"}, {\"AttributeName\":\"TopScore\",\"KeyType\":\"RANGE\"}], \"Projection\":{ \"ProjectionType\":\"INCLUDE\", \"NonKeyAttributes\":[\"UserId\"] }, \"ProvisionedThroughput\": { \"ReadCapacityUnits\": 50, \"WriteCapacityUnits\": 25 },\"WarmThroughput\": { \"ReadUnitsPerSecond\": 1987, \"WriteUnitsPerSecond\": 543 } } ]" \ --warm-throughput ReadUnitsPerSecond=12345,WriteUnitsPerSecond=4567 \ --region us-east-1 -
Você receberá uma resposta semelhante à seguinte. Suas configurações de
WarmThroughputserão exibidas comoReadUnitsPerSecondeWriteUnitsPerSecond. OStatusseráUPDATINGquando o valor de throughput a quente estiver sendo atualizado, eACTIVEquando o novo valor de throughput a quente for definido.{ "TableDescription": { "AttributeDefinitions": [ { "AttributeName": "GameTitle", "AttributeType": "S" }, { "AttributeName": "TopScore", "AttributeType": "N" }, { "AttributeName": "UserId", "AttributeType": "S" } ], "TableName": "GameScores", "KeySchema": [ { "AttributeName": "UserId", "KeyType": "HASH" }, { "AttributeName": "GameTitle", "KeyType": "RANGE" } ], "TableStatus": "CREATING", "CreationDateTime": 1730241788.779, "ProvisionedThroughput": { "NumberOfDecreasesToday": 0, "ReadCapacityUnits": 20, "WriteCapacityUnits": 10 }, "TableSizeBytes": 0, "ItemCount": 0, "TableArn": "arn:aws:dynamodb:us-east-1:XXXXXXXXXXXX:table/GameScores", "TableId": "XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "GlobalSecondaryIndexes": [ { "IndexName": "GameTitleIndex", "KeySchema": [ { "AttributeName": "GameTitle", "KeyType": "HASH" }, { "AttributeName": "TopScore", "KeyType": "RANGE" } ], "Projection": { "ProjectionType": "INCLUDE", "NonKeyAttributes": [ "UserId" ] }, "IndexStatus": "CREATING", "ProvisionedThroughput": { "NumberOfDecreasesToday": 0, "ReadCapacityUnits": 50, "WriteCapacityUnits": 25 }, "IndexSizeBytes": 0, "ItemCount": 0, "IndexArn": "arn:aws:dynamodb:us-east-1:XXXXXXXXXXXX:table/GameScores/index/GameTitleIndex", "WarmThroughput": { "ReadUnitsPerSecond": 1987, "WriteUnitsPerSecond": 543, "Status": "UPDATING" } } ], "DeletionProtectionEnabled": false, "WarmThroughput": { "ReadUnitsPerSecond": 12345, "WriteUnitsPerSecond": 4567, "Status": "UPDATING" } } }
Os exemplos de SDK a seguir mostram como criar uma tabela do DynamoDB com valores personalizados de throughput a quente.