Creación de una tabla de DynamoDB nueva con rendimiento en caliente más alto
Puede ajustar los valores de rendimiento en caliente cuando cree la tabla de DynamoDB según los pasos que se indican a continuación. Estos pasos también se aplican al crear una tabla global o un índice secundario.
Para crear una tabla de DynamoDB y ajustar los valores de rendimiento en caliente a través de la consola:
Inicie sesión en la AWS Management Console y abra la consola de DynamoDB en https://console.aws.amazon.com/dynamodb/
. -
Seleccione Crear tabla.
-
Elija un nombre de tabla, una clave de partición y una clave de clasificación (opcional).
-
En Configuración de la tabla, elija Personalizar configuración.
-
En el campo Rendimiento en caliente, seleccione Aumentar el rendimiento en caliente.
-
Ajuste las unidades de lectura por segundo y las unidades de escritura por segundo. Estas dos configuraciones definen el rendimiento máximo que la tabla puede gestionar al instante.
-
Continúe agregando los detalles de tabla restantes y, a continuación, seleccione Crear tabla.
En el siguiente ejemplo de la AWS CLI se muestra cómo crear una tabla de DynamoDB con valores de rendimiento en caliente personalizados.
-
Ejecute la operación
create-tablepara crear la siguiente tabla de 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 -
Verá una respuesta similar a la siguiente. La configuración de
WarmThroughputse mostrará comoReadUnitsPerSecondyWriteUnitsPerSecond. ElStatusseráUPDATINGcuando se actualice el valor de rendimiento en caliente yACTIVEcuando se establezca el nuevo valor de rendimiento en caliente.{ "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" } } }
En los siguientes ejemplos del SDK se muestra cómo crear una tabla de DynamoDB con valores de rendimiento en caliente personalizados.