Skip to main content

DynamoDB Audit Store

The DynamoDB audit store (DynamoSyncAuditStore) enables Flamingock to record execution history and ensure safe coordination across distributed deployments using Amazon DynamoDB as the storage backend.

For a conceptual explanation of the audit store vs target systems, see Audit store vs target system.

Version compatibility

ComponentVersion Requirement
AWS SDK DynamoDB Enhanced2.25.0+

AWS SDK DynamoDB Enhanced 2.25.0+ is required and must be included in your project dependencies.

Installation

Add the AWS SDK DynamoDB Enhanced dependency to your project:

implementation("software.amazon.awssdk:dynamodb-enhanced:2.28.0")

Basic setup

Configure the audit store using a DynamoDB Target System to get the connection configuration:

var auditStore = DynamoDBAuditStore.from(dynamoDBTargetSystem);

A DynamoDBAuditStore must be created from an existing DynamoDBTargetSystem.

This ensures that both components point to the same external DynamoDB instance:

  • The Target System applies your business changes.
  • The Audit Store stores the execution history associated with those changes.

Internally, the Audit Store takes the Target System’s connection settings (DynamoClient) and creates its own dedicated access handle, keeping audit operations isolated while still referring to the same physical system.

For a full conceptual explanation of this relationship, see Target Systems vs Audit Store.

Optional configurations can be added via .withXXX() methods.

Register Audit Store

Once created, you need to register this audit store with Flamingock. See Registering the community audit store for details.

Optional configuration (.withXXX() methods)

These configurations can be customized via .withXXX() methods with no global context fallback:

ConfigurationMethodDefaultDescription
Auto Create.withAutoCreate(enabled)trueAuto-create table
Read Capacity Units.withReadCapacityUnits(units)5Read capacity units (PROVISIONED mode only)
Write Capacity Units.withWriteCapacityUnits(units)5Write capacity units (PROVISIONED mode only)
Audit Repository Name.withAuditRepositoryName(name)flamingockAuditLogTable name for audit entries
Lock Repository Name.withLockRepositoryName(name)flamingockLockTable name for distributed locks

⚠️ Warning: Adjust capacity units based on your workload. Under-provisioning may cause throttling. Consider using ON_DEMAND billing mode for unpredictable workloads.

Configuration example

Here's a comprehensive example showing the configuration:

// Create a DynamodDB Target System
DynamodDBTargetSystem dynamoDBTargetSystem = new DynamodDBTargetSystem("dynamodb", dynamoDbClient);
// Audit store configuration (mandatory via constructor)
var auditStore = DynamoSyncAuditStore.from(dynamoDBTargetSystem)
.withReadCapacityUnits(10) // Optional configuration
.withWriteCapacityUnits(10); // Optional configuration

// Register with Flamingock
Flamingock.builder()
.setAuditStore(auditStore)
.addTargetSystems(targetSystems...)
.build();

Audit store configuration resolution:

  • DynamoDBTargetSystem: Must be provided via from() method. Gets DynamoClient from the target system.
  • Capacity settings: Uses explicit configuration via properties

This architecture ensures explicit audit store configuration with no fallback dependencies.

Next steps