---
title: "DynamoDB | Speedscale Docs"
description: "Explore how to use Speedscale's pre-made DynamoDB mock for quick API testing, including importing, inspecting, and modifying request and response formats."
canonical: "https://docs.speedscale.com/proxymock/aws/dynamodb/"
---

[Documentation index](https://docs.speedscale.com/proxymock/llms.txt) | [Markdown](https://docs.speedscale.com/proxymock/aws/dynamodb/index.md) | [Canonical page](https://docs.speedscale.com/proxymock/aws/dynamodb/)

# DynamoDB

<a id="dynamodb-mock"></a>

## DynamoDB Mock

As a convenience, we provide a pre-made mock to get you started quickly with AWS DynamoDB. You can find the pre-made mock recording [here](https://github.com/speedscale/demo/blob/master/aws/service/dynamodb/go/snapshots/default.jsonl). The parent directory contains the code for the demo app that was used to generate the mock.

<a id="importing-and-inspecting-the-mock"></a>

## Importing and Inspecting the Mock

To import the mock, you can use the following command (point to the file in your local directory):

```bash
proxymock import --file default.jsonl
```

The import prints the directory it wrote the RRPair files to (under `proxymock/`). Run the following command to browse the mock in your browser:

```bash
proxymock web --in <directory>
```

<a id="request-format"></a>

## Request Format

For general information about AWS APIs, please see our [notes](https://docs.speedscale.com/proxymock/aws/). Speedscale's AWS DynamoDB default mock has recordings for the following operations:

*   CreateTable
*   GetItem
*   PutItem
*   UpdateItem
*   DeleteItem
*   Scan
*   Query
*   DeleteTable
*   BatchGetItem
*   BatchWriteItem

Open the request body of one of the Query operations:

```json
{
  "ExpressionAttributeValues": {
    ":id": {
      "S": "1"
    }
  },
  "KeyConditionExpression": "ID = :id",
  "TableName": "DemoTable"
}
```

You can learn more about this format from the AWS [documentation](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ConditionExpressions.html). To modify the query, you need to modify the request body. Unless you change the command type you don't need to edit query parameters or headers to mock this protocol.

<a id="response-format"></a>

## Response Format

```json
{
  "Count": 1,
  "Items": [
    {
      "value": {
        "S": "Value1"
      },
      "ID": {
        "S": "1"
      },
      "name": {
        "S": "Item1"
      },
      "Value": {
        "S": "UpdatedValue1"
      }
    }
  ],
  "ScannedCount": 1
}
```

To modify the response returned by the mock, change the payload in the recording. The exact format of DynamoDB responses can be observed using the AWS CLI. The pattern is fairly straightforward with the key names and IDs outlined in the JSON.
