Skip to main content

DynamoDB

Default profile points to staging account (468036072962, us-east-1).

For the load-bearing tables (indexer jobs, index settings, Shopify entities), read the access-patterns cheat sheet before hand-rolling a query — it has the exact key formats, the GSI lookup paths, and copy-pasteable read-only CLI, so you don't fall back to a scan.

Quick Reference

# List all tables
aws dynamodb list-tables --output table

# Describe a table (schema, GSIs, stream, item count)
aws dynamodb describe-table --table-name staging-EcomIndexSettingsTable

# Scan first N items
aws dynamodb scan --table-name staging-EcomIndexSettingsTable --max-items 5

# Query by partition key
aws dynamodb query --table-name staging-EcomIndexSettingsTable \
--key-condition-expression "pk = :pk" \
--expression-attribute-values '{":pk": {"S": "fnqm9psx"}}'

# Query with sort key prefix
aws dynamodb query --table-name staging-EcomIndexSettingsTable \
--key-condition-expression "pk = :pk AND begins_with(sk, :skp)" \
--expression-attribute-values '{":pk": {"S": "fnqm9psx"}, ":skp": {"S": "INDEX#"}}'

# Query a GSI
aws dynamodb query --table-name staging-EcomIndexerJobsTable \
--index-name GSI_JobLookup_v2 \
--key-condition-expression "job_id = :jid" \
--expression-attribute-values '{":jid": {"S": "some-job-id"}}'

# Check DynamoDB Streams (for settings exporter issues)
aws dynamodbstreams list-streams --table-name staging-EcomIndexSettingsTable

Table Naming Convention

{env_prefix}-{TableName} where env_prefix is:

  • Dev: dev-{branch} (e.g., dev-oliver-EcomIndexSettingsTable)
  • Staging: staging
  • Preprod: preprod
  • Prod: prod (account 023568249301)

Exception: UsersAccountsTable has no prefix in staging (shared globally).

Parsing DynamoDB Output

# Human-readable scan output
aws dynamodb scan --table-name staging-ShopifyEntitiesTable --max-items 5 \
--output json | python3 -c "
import sys, json
for i in json.load(sys.stdin).get('Items', []):
print({k: list(v.values())[0] for k, v in i.items()})
"

What to Look For

SymptomCheck
Missing index settingsScan EcomIndexSettingsTable for the account's pk
Stale KV dataCheck stream status on EcomIndexSettingsTable (settings exporter reads the stream)
Indexing job stuckQuery EcomIndexerJobsTable GSI_JobsByStatus_v2 for the shop_id
Missing user/accountScan UsersAccountsTable for the pk
Fork not progressingQuery IndexForksTable for the account pk
Merchandising not syncingScan MerchandisingTable for the account pk