@@ -234,19 +234,21 @@ It creates a database backed by the local file system (or, optionally, in memory
...
@@ -234,19 +234,21 @@ It creates a database backed by the local file system (or, optionally, in memory
DynamoDB is a distributed NoSQL column-family datastore by Amazon, available as-a-Service on AWS.
DynamoDB is a distributed NoSQL column-family datastore by Amazon, available as-a-Service on AWS.
To use the DynamoDB storage backend, a table must already exist in DynamoDB.
To use the DynamoDB storage backend, a table must already exist in DynamoDB.
It should have the String Hash Key "Key" and a [Number field "Expiry" that is enabled as the TTL attribute](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/time-to-live-ttl-how-to.html).
It should have a composite key with the String Hash Key "Keygroup" and String Range Key "Key", and a [Number field "Expiry" that is enabled as the TTL attribute](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/time-to-live-ttl-how-to.html).
Furthermore, the `fred` process that talks to DynamoDB should have IAM keys configured as environment variables and the corresponding IAM user must have permission to access the table.
Furthermore, the `fred` process that talks to DynamoDB should have IAM keys configured as environment variables and the corresponding IAM user must have permission to access the table.
To create a table named `fred` (this must be passed in as command-line parameter `--dynamo-table=fred`) using the AWS CLI:
To create a table named `fred` (this must be passed in as command-line parameter `--dynamo-table=fred`) using the AWS CLI (feel free to adapt provisioned throughput to suit your needs):
```bash
```bash
AWS_PAGER="" aws dynamodb create-table --table-name fred --attribute-definitions"AttributeName=Key,AttributeType=S"--key-schema"AttributeName=Key,KeyType=HASH"--provisioned-throughput"ReadCapacityUnits=1,WriteCapacityUnits=1"
export AWS_PAGER=""
AWS_PAGER="" aws dynamodb update-time-to-live --table-name fred --time-to-live-specification"Enabled=true, AttributeName=Expiry"
aws dynamodb create-table --table-name fred --attribute-definitions"AttributeName=Keygroup,AttributeType=S AttributeName=Key,AttributeType=S"--key-schema"AttributeName=Keygroup,KeyType=HASH AttributeName=Key,KeyType=RANGE"--provisioned-throughput"ReadCapacityUnits=1,WriteCapacityUnits=1"
aws dynamodb update-time-to-live --table-name fred --time-to-live-specification"Enabled=true, AttributeName=Expiry"
```
```
To delete the table:
To delete the table:
```bash
```bash
AWS_PAGER="" aws dynamodb delete-table --table-name fred