Skip to content

Conversation

tebanieo
Copy link
Contributor

#7554

Add AdaptiveRetryStrategy Examples for DynamoDB Java SDK v2

This PR adds comprehensive examples and documentation for implementing AdaptiveRetryStrategy with Amazon DynamoDB using AWS SDK for Java 2.x. These examples demonstrate how to migrate from StandardRetryStrategy to AdaptiveRetryStrategy for improved retry behavior and performance.

What's New

New Examples:

  • BasicAdaptiveRetryImplementation.java - Basic setup and configuration patterns
  • MigrationExamples.java - Before/after migration examples with detailed comparisons

Documentation:

  • Comprehensive documentation in adaptive_retry_docs/ directory
  • Migration guide with step-by-step instructions
  • Configuration reference with best practices
  • Conceptual overview of when and why to use AdaptiveRetryStrategy

Problem Solved

  • Provides concrete examples for developers wanting to implement adaptive retry strategies
  • Addresses the gap in documentation for migrating from default retry approaches
  • Demonstrates AWS SDK v2 best practices for retry configuration

Key Features

Adaptive Retry Benefits:

  • Client-side rate limiting to prevent retry storms
  • Intelligent throttling detection with separate backoff strategies
  • Built-in circuit breaking for failure protection
  • Adaptive learning from retry patterns

Migration Examples:

  • Basic standard-to-adaptive migration
  • Custom backoff configuration
  • High-throughput application optimization
  • Batch operation retry strategies

Files Added/Modified

New Files:

javav2/example_code/dynamodb/src/main/java/com/example/dynamodb/ 
├── BasicAdaptiveRetryImplementation.java 
├── MigrationExamples.java 
└── README_ADAPTIVE_RETRY.md

javav2/example_code/dynamodb/adaptive_retry_docs/ 
├── README.md 
├── concepts.md 
├── migration-guide.md 
└── configuration-reference.md

Modified Files:

  • javav2/example_code/dynamodb/README.md - Added links to new retry strategy examples
  • javav2/example_code/dynamodb/src/test/java/DynamoDBTest.java - Added test coverage

Usage Examples

// Basic AdaptiveRetryStrategy setup
DynamoDbClient client = DynamoDbClient.builder()
    .region(Region.US_EAST_1)
    .overrideConfiguration(ClientOverrideConfiguration.builder()
        .retryStrategy(AdaptiveRetryStrategy.builder()
            .maxAttempts(3)
            .backoffStrategy(BackoffStrategy.exponentialDelay(
                Duration.ofMillis(100), Duration.ofSeconds(20)))
            .throttlingBackoffStrategy(BackoffStrategy.exponentialDelay(
                Duration.ofSeconds(1), Duration.ofSeconds(20)))
            .build())
        .build())
    .build();

Related Documentation


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the Java-v2 This issue relates to the AWS SDK for Java V2 label Aug 20, 2025
@scmacdon scmacdon added On Call Review complete On call review complete Task A general update to the code base for language clarification, missing actions, tests, etc. labels Sep 15, 2025
@scmacdon scmacdon force-pushed the enhancement-7554-tebanieo branch from 5207953 to 9d47276 Compare September 15, 2025 19:53
@scmacdon
Copy link
Contributor

The Readme must be done using the Write me tool

@tejasgn1 tejasgn1 removed the On Call Review complete On call review complete label Sep 22, 2025
@tejasgn1 tejasgn1 force-pushed the enhancement-7554-tebanieo branch from 1bf5e13 to c244d15 Compare September 25, 2025 20:49
@tejasgn1 tejasgn1 added the On Call Review complete On call review complete label Sep 25, 2025
@tejasgn1 tejasgn1 merged commit 8d00647 into awsdocs:main Sep 25, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java-v2 This issue relates to the AWS SDK for Java V2 On Call Review complete On call review complete Task A general update to the code base for language clarification, missing actions, tests, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants