Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.
Creazione di una nuova tabella DynamoDB con throughput caldo più elevato
È possibile regolare i valori di throughput a caldo quando si crea una tabella DynamoDB attraverso la procedura seguente. Queste fasi si applicano anche alla creazione di una tabella globale o di un indice secondario.
Per creare una tabella DynamoDB e regolare i valori di throughput a caldo tramite la console:
Accedi Console di gestione AWS e apri la console DynamoDB all'indirizzo. https://console.aws.amazon.com/dynamodb/
-
Seleziona Crea tabella.
-
Seleziona un Nome tabella, una Chiave di partizione e una Chiave di ordinamento (opzionale).
-
Per Impostazioni tabella, seleziona Personalizza impostazioni.
-
Nel campo Throughput a caldo, seleziona Aumentare il throughput a caldo.
-
Regola le Unità di lettura al secondo e le Unità di scrittura al secondo. Queste due impostazioni definiscono il throughput massimo che la tabella può gestire in modo istantaneo.
-
Continua ad aggiungere i dettagli rimanenti della tabella, quindi seleziona Crea tabella.
L' AWS CLI esempio seguente mostra come creare una tabella DynamoDB con valori di throughput caldi personalizzati.
-
Esegui l’operazione
create-tableper creare la seguente tabella DynamoDB.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 -
Riceverai una risposta simile a quella seguente. Le impostazioni sul
WarmThroughputverranno visualizzate comeReadUnitsPerSecondeWriteUnitsPerSecond.StatusrisulteràUPDATINGquando verrà aggiornato il valore di throughput a caldo eACTIVEquando sarà stato impostato il nuovo valore di throughput a caldo.{ "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" } } }
Gli esempi dell’SDK seguenti mostrano come creare una tabella DynamoDB con valori di throughput a caldo personalizzati.