Skip navigation links

Infinispan DynamoDB cache store v3.5.2

Cache loader / writer for an AWS DynamoDB database backend.

See: Description

Packages 
Package Description
com.nimbusds.infinispan.persistence.dynamodb
DynamoDB store for Infinispan.
com.nimbusds.infinispan.persistence.dynamodb.config
Configuration classes.
com.nimbusds.infinispan.persistence.dynamodb.logging
Logging.
com.nimbusds.infinispan.persistence.dynamodb.query
DynamoDB query executor interfaces.

Cache loader / writer for an AWS DynamoDB database backend.

Requirements

Features

Usage

  1. Add the Maven dependency coordinates for the DynamoDB cache store to your project.
  2. Implement DynamoDBItemTransformer to translate between Infinispan entries (key / value pairs with optional metadata) and DynamoDB items.
  3. Configure a DynamoDB store for each Infinispan cache that requires one, by setting the attributes specified in DynamoDBStoreConfiguration. Also, see the example below. Note that the DynamoDB store can safely shared between multiple replicated / distributed instances of a cache. It can also be used in read-only mode.
  4. Make sure the AWS credentials for accessing the DynamoDB table(s) are configured in way that the default AWS credentials provider chain can look them up, e.g. by setting the aws.accessKeyId and aws.secretKey Java system properties.

Maven

Maven coordinates:

<dependency>
    <groupId>com.nimbusds</groupId>
    <artifactId>infinispan-cachestore-dynamodb</artifactId>
    <version>[ version ]</version>
</dependency>

where [ version ] should be the latest stable version.

Example configuration

<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="urn:infinispan:config:9.4 http://www.infinispan.org/schemas/infinispan-config-9.4.xsd"
               xmlns="urn:infinispan:config:9.4"
               xmlns:dynamodb="urn:infinispan:config:store:dynamodb:1.5">

    <cache-container name="myCacheContainer" default-cache="users">
        <jmx duplicate-domains="true"/>
        <local-cache name="users">
            <eviction size="100"/>
            <persistence>
                <dynamodb:dynamodb-store
                    shared="true"
                    region="us-east-1"
                    item-transformer="com.nimbusds.infinispan.persistence.dynamodb.UserItemTransformer"
                    table-prefix="myapp_"
                />
            </persistence>
        </local-cache>
    </cache-container>

</infinispan>
Skip navigation links

Copyright © 2019 Connect2id Ltd.. All rights reserved.