Amazon DynamoDB
Developer Guide (API Version 2012-08-10)

Python and DAX

To run the Python sample application on your Amazon EC2 instance, follow this proceedure:

  1. Install the DAX Python client using the pip utility:

    pip install amazon-dax-client
  2. Download the sample program source code (.zip file):


    When the download is complete, extract the source files:

  3. Run the following Python programs:

    python python

    The first program creates a DynamoDB table named TryDaxTable. The second program writes data to the table.

  4. Run the following Python programs:

    python python python

    Take note of the timing information—the number of milliseconds required for the GetItem, Query and Scan tests.

  5. In the previous step, you ran the programs against the DynamoDB endpoint. You will now run the programs again, but this time the GetItem, Query and Scan operations will be processed by your DAX cluster.

    To determine the endpoint for your DAX cluster, choose one of the following:

    • Using the DynamoDB console—choose your DAX cluster. The cluster endpoint is shown in the console. For example:
    • Using the AWS CLI—type the following command:

      aws dax describe-clusters --query "Clusters[*].ClusterDiscoveryEndpoint"

      The cluster endpoint port and address are shown in the output. For example:

      { "Port": 8111, "Address":"" }

    Now run the programs again—but this time, specify the cluster endpoint as a command line parameter:

    python python python

    Look at the rest of the output, and take note of the timing information. The elapsed times for GetItem, Query and Scan should be significantly lower with DAX than with DynamoDB.

  6. Run the following Python program to delete TryDaxTable:


For more information about these programs, see the following sections: