Skip to content

Instantly share code, notes, and snippets.

@cham11ng
Last active August 5, 2019 16:09
Show Gist options
  • Save cham11ng/8f534692ba4fd5c39738d2f7237ff751 to your computer and use it in GitHub Desktop.
Save cham11ng/8f534692ba4fd5c39738d2f7237ff751 to your computer and use it in GitHub Desktop.
DynamoDB KickOff

DynamoDB Basics

Tables, attributes, and other objects in DynamoDB must have names. All names must be encoded using UTF-8, and are case-sensitive.

Table names and index names must be between 3 and 255 characters long, and can contain only the following characters:

  • a-z
  • A-Z
  • 0-9
  • _ (underscore)
    • (dash)
  • . (dot)

Attribute names must be between 1 and 255 characters long.

  • Scalar Types – A scalar type can represent exactly one value. The scalar types are number, string, binary, Boolean, and null.

  • Document Types – A document type can represent a complex structure with nested attributes, such as you would find in a JSON document. The document types are list and map.

  • Set Types – A set type can represent multiple scalar values. The set types are string set, number set, and binary set.

DynamoDB Local Setup

# Pull DynamoDb docker image and run it locally
➜ docker run -p 8000:8000 amazon/dynamodb-local

# Install awscli
➜ brew install awscli # For mac

# Configure AWS
➜ aws configure
AWS Access Key ID [******************]: **
AWS Secret Access Key [******************]: **
Default region name [US-EAST-1]: US-EAST-1
Default output format [**]: json

# List tables
➜ aws dynamodb list-tables --endpoint-url http://localhost:8000
{
  "TableNames": []
}

DynamoDB Node.js packages

Examples

Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment