Overview

This is the main documentation for the gora-dynamodb module. gora-dynamodb module enables Amazon DynamoDB backend support for Gora.

Gora DynamoDB Properties - gora.properties

gora.datastore.default=org.apache.gora.dynamodb.store.DynamoDBStore
gora.datastore.autocreateschema=true
preferred.schema.name=Person
gora.dynamodb.mapping.file=/path/to/gora-dynamodb-mapping.xml
gora.dynamodb.client=sync
gora.dynamodb.consistent.reads=true
gora.dynamodb.endpoint=http://dynamodb.ap-northeast-1.amazonaws.com/
gora.dynamodb.serialization.type=dynamo
Property Key Property Value Required Description
gora.datastore.default org.apache.gora.dynamodb.store.DynamoDBStore Yes Implementation of the storage class
gora.datastore.autocreateschema true No Create the table if it doesn’t exist
preferred.schema.name Person Yes Name of the DynamoDB table/schema
gora.dynamodb.mapping.file /path/to/gora-dynamodb-mapping.xml No The XML mapping file to be used. Defaults to gora-dynamodb-mapping.xml
gora.dynamodb.client sync No DynamoDB client type. It could be sync or async.
gora.dynamodb.consistent.reads true No Default is eventual consistence i.e. false.
gora.dynamodb.endpoint http://dynamodb.us-east-1.amazonaws.com/ Yes Set to geographically closest service endpoint. For accepted list, see here
gora.dynamodb.serialization.type dynamo No Data store serialization type. It could be 'dynamo' or 'avro'

Accepted list of endpoints

Gora DynamoDB mapppings - gora-dynamodb-mapping.xml

Say we wished to map some user data and store it into DynamoDB.

<gora-otd>
    <table name="Person" readcunit="1" writecunit="1" package="org.apache.gora.dynamodb.example.generated">
    <attribute name="ssn" type="N" key="hash"/>
    <attribute name="date" type="S" key="hashrange"/>
    <attribute name="firstName" type="S"/>
    <attribute name="lastName" type="S"/>
    <attribute name="salary" type="N"/>
    <attribute name="visitedplaces" type="SS"/>
</gora-otd>

Within the gora-otd mapping configuration, only the 'table' child element is required.

Table

Attributes