dynamodb-mock /

Filename Size Date modified Message
102 B
96 B
2.9 KB
7.5 KB
144 B
4.1 KB
715 B
715 B
855 B
781 B

ddbmock -- a DynamoDB mock implementation.


DynamoDB is a minimalistic NoSQL engine provided by Amazon as a part of their AWS product.

DynamoDB allows you to store documents composed of unicode, number or binary data as well are sets. Each tables must define a hash_key and may define a range_key. All other fields are optional.

DynamoDB is really awesome but is terribly slooooow with managment tasks. This makes it completly unusable in test environements

ddbmock brings a nice, tiny, in-memory implementation of DynamoDB along with much better and detailed error messages. Among its niceties, it features a double entry point:

  • regular network based entry-point with 1:1 correspondance with stock DynamoDB
  • embeded entry-point with seamless boto intergration 1, ideal to avoid spinning yet another server.

What is/will ddbmock be useful for ?

  • running unit test FAST. DONE
  • running functional test FAST. DONE
  • experiment with DynamoDB API. DONE
  • plan Throughput usage. WIP (low level foundation done)
  • plan actual storage space requirements. DONE (describe table returns accurate size !)
  • perform simulations with accurate limitations. Even some undocumented "features" are accurate :)

Current status

ddbmock is an experimental project and is currently under heavy development. It also may be discontinued at any time.

  • support full table life-cycle
  • support full item life-cycle
  • support for all item limitations
  • accurate size and date reporting
  • Query, Scan, BatchGetItem and BatchWriteItem support is preliminary
  • no limits on concurent table operations
  • no limits for request/response size nor item count in those

See for detailed up-to-date status.

Example usage

Run as Regular client-server

Ideal for test environment. For stage and production I highly recommend using DynamoDB servers. ddbmock comes with no warranty and will loose your data(tm).

Launch the server

$ pserve development.ini # launch the server on

Start the client

import boto
from ddbmock import connect_ddbmock

# Use the provided helper to connect your *own* endpoint
db = connect_ddbmock()

# Done ! just use it wherever in your project as usual.
db.list_tables() # get list of tables (empty at this stage)

Note: if you do not want to import ddbmock only for the helper, here is a reference implementation:

def connect_ddbmock(host='localhost', port=6543):
    import boto
    from boto.regioninfo import RegionInfo
    endpoint = '{}:{}'.format(host, port)
    region = RegionInfo(name='ddbmock', endpoint=endpoint)
    return boto.connect_dynamodb(region=region, port=port, is_secure=False)

Run as a standalone library

Ideal for unit testing or small scale automated functional tests. Nice to play around with boto DynamoDB API too :)

import boto
from ddbmock import connect_boto

# Wire-up boto and ddbmock together
db = connect_boto()

# Done ! just use it wherever in your project as usual.
db.list_tables() # get list of tables (empty at this stage)


  • Python 2.7.x
  • Pyramid >= 1.3
  • Boto >= 2.5.0 (optional)
  • NO AWS account :)