Skip to main content
This hands-on guide demonstrates how to create and use an Amazon DynamoDB table from the AWS Management Console using a simple e-commerce example: storing customer orders. You will create a table, insert items, run queries, inspect monitoring, and finally delete the table to avoid charges. Key concepts covered:
  • Table creation and primary key design
  • Capacity modes and auto scaling
  • Adding and querying items (Console + PartiQL)
  • Monitoring, backups/replication, and cleanup

Step 1 — Create the table and choose a primary key

Open the DynamoDB service in the AWS Console and create a new table named orders. The most important design decision is choosing the primary key. This controls how efficiently you can retrieve items. For this demo:
  • Partition key: customerId (String) — use this to fetch all orders for a specific customer.
  • Sort key: orderId (String) — ensures each order for a given customer is unique and enables range queries.
Primary key tips:
  • Use a single partition key when every item is unique (e.g., profile records).
  • Use a composite key (partition + sort) when multiple related items share the same partition (e.g., orders for a customer).
  • Design keys based on access patterns — table design is driven by how you will query the data.

Capacity mode, table class, and advanced options

You can accept defaults or click Customize to review:
  • Table class: Standard or Standard-Infrequent Access (for less frequently accessed data).
  • Capacity mode: On-demand (pay-per-request) or Provisioned (pre-allocated RCUs/WCUs).
  • Encryption at rest and deletion protection.
If you choose Provisioned capacity, you can enable auto scaling for read and/or write capacity. Auto scaling requires a minimum, maximum, and a target utilization percentage (commonly ~70%).
You can review estimated monthly cost and encryption settings before creating the table.
Create the table. It will take a few seconds to become Active. Once active, open the table to inspect configuration and metrics.
The overview displays:
  • Primary key schema (customerId, orderId)
  • Table status (Active)
  • Item count, table size, average item size
  • Capacity metrics and summary information

Indexes, monitoring, and replication

To support additional access patterns, create Global Secondary Indexes (GSIs) or Local Secondary Indexes (LSIs) from the Indexes tab.
Monitoring integrates with CloudWatch and shows graphs for reads/writes, throttling, latency, and alarms. The Monitor tab provides the live metrics you need to tune capacity or investigate performance.
Global table replicas appear under Global tables, and Exports & Streams offers backups, export-to-S3, and DynamoDB Streams / Kinesis integration.

Step 2 — Insert sample items via the Console

Open Explore table items to run Scans or Queries and to inspect item data. For production use prefer the AWS SDK or AWS CLI, but the Console is useful for quick tests.
Click Create item and provide values for the partition and sort keys. Make sure numeric attributes are typed as Number and booleans as Boolean in the Console. Example items for this demo (JSON representation):
After creating items, use Query operations to fetch items efficiently. Queries require the partition key value. For example, to retrieve all orders for CUST-1 use:
  • customerId = "CUST-1"
Queries can also use a KeyConditionExpression on the sort key (e.g., range queries on orderId) or a FilterExpression for non-key attributes (e.g., price > 60). Important: filter expressions are applied after the read and do not reduce the read capacity units consumed by the underlying query. Example (Console):
  • Query partition key customerId = "CUST-1"
  • Add FilterExpression: price > 60 Result: both items for CUST-1 are read, but only the item with price = 100 is returned.
You can edit items (Edit item → Save) or delete items (select → Delete item) directly from the Console.

PartiQL: a SQL-like option

DynamoDB supports PartiQL — a SQL-compatible language that maps to DynamoDB operations. PartiQL is useful for users familiar with SQL, but the same DynamoDB access patterns and limits still apply.
Useful PartiQL examples:
  • Select all orders for a customer:
    • SELECT * FROM "orders" WHERE "customerId" = 'CUST-1'
  • Filter by price (note: this still maps to DynamoDB reads/filters):
    • SELECT * FROM "orders" WHERE "customerId" = 'CUST-1' AND "price" > 60

Step 3 — Monitor, then delete the table

After running reads/writes, check the Monitor tab to view actual read/write metrics, throttles, and latency trends. When you finish the demo, delete the table to avoid ongoing charges:
  • Select the table → Delete → confirm.
Deleting a table is irreversible and removes all data. Consider enabling deletion protection or creating a backup if you need to retain data before deletion.

Quick reference table

Additional resources

Key takeaways:
  • Choose a primary key that matches your read/write access patterns (partition key for customer queries; add a sort key for multiple items per customer).
  • Prefer Query over Scan to reduce costs and improve performance.
  • Choose capacity mode based on traffic predictability; use Provisioned mode with auto scaling for predictable workloads.
  • PartiQL offers SQL-like convenience but maps to the same DynamoDB operations and limits.
That concludes this step-by-step DynamoDB Console demo.

Watch Video