Infinispan DynamoDB Cache Store

Cache loader / writer for an AWS DynamoDB database backend.


  • Infinispan 8.2+
  • Java 8+
  • AWS DynamoDB database


  • Implements the complete AdvancedLoadWriteStore SPI
  • Provides an interface for transforming Infinispan entries to / from structured DynamoDB items
  • Provides an optional interface for executing arbitrary queries against DynamoDB, bypassing the standard Infinispan load store API
  • Optional transparent application of a range key to facilitate multi-tenancy: sharing a table among multiple Infinispan caches of the same type, while keeping data access isolated
  • Optional transparent DynamoDB table name prefixing
  • Dropwizard Metrics: Read, put, delete, process and purge operation timers
  • System property interpolation for all configuration properties using a ${sys-prop-name:default-value} format
  • Multi-level logging via Log4j2
  • Open source (Apache 2.0 license)


  • Add the Maven dependency coordinates for the DynamoDB cache store to your project.
  • Implement DynamoDBItemTransformer to translate between Infinispan entries (key / value pairs with optional metadata) and DynamoDB items.
  • 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.
  • 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. See


Maven coordinates:

    <version>[ version ]</version>

where [ version ] should be the latest stable version.

Example configuration

<infinispan xmlns:xsi=""

    <cache-container name="myCacheContainer" default-cache="users">
        <jmx duplicate-domains="true"/>
        <local-cache name="users">
            <eviction size="100"/>


Change Log

  • version 1.0 (2017-09-29)

    • First public release, requires Infinispan 8.2+ and Java 8+.
  • version 1.1 (2017-10-11)

    • Simplifies DynamoDBItemTransformer interface. The hash key attribute name is returned directly by the getHashKeyAttributeName method. The hash key value is resolved and returned directly by the resolveHashKey method. This is a breaking change.
  • version 1.2 (2017-10-17)

    • Adds DynamoDBQueryExecutor interface and supporting classes for executing direct queries against the DynamoDB database. The attributes used as keys in the queries must be indexed (as global secondary index).
  • version 1.2.1 (2017-10-17)

    • Updates SimpleMatchQueryExecutor to allow key names that otherwise clash with reserved key words, such as SUB, in DynamoDB.
  • version 1.3 (2017-10-18)

    • Adds MetadataUtils with methods for encoding Infinispan metadata timestamps into DynamoDB items and parsing the metadata back.
    • Moves loggers into own package.
  • version 1.4 (2017-10-18)

    • Updates MetadataUtils.addMetadata to return the (modified) Item.
  • version 1.5 (2017-10-21)

    • Removes aws-access-key-id and aws-secret-access-key DynamoDB store configuration attributes, switches to AWS SDK's DefaultAWSCredentialsProviderChain which provides a richer set of options for setting the AWS credentials.
  • version 1.5.1 (2017-11-02)

    • Adds "endpoint" parameter check for non-blank.
  • version 1.5.2 (2017-11-02)

    • Fixes "region" parameter parsing (issue #5).
  • version 1.5.3 (2017-11-24)

    • Switches to com.amazonaws:aws-java-sdk-bundle:1.11.235 dependency with shaded transient dependencies to prevent potential conflicts.