Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 28, 2026

Implements AWS DynamoDB as a distributed lock backend, following the established patterns from Firestore and Etcd implementations.

Implementation

Module Structure

  • locker-dynamodb/ - New module with standard Maven structure
  • DynamoDbLockService - LockService implementation using AWS SDK v2
  • LockerAwsDynamoDbConfig - Spring bean configuration
  • LockerAwsDynamoDbClientConfig - DynamoDB client setup with credential chain support

Lock Operations

  • Acquire: Conditional PutItem with attribute_not_exists check
  • Renew: Conditional update matching expiry/owner/instanceId
  • Release: Conditional delete with ownership verification
  • Uses DynamoDB TTL on expiry field for automatic cleanup

Configuration

locker.dynamodb.tableName=locks           # Default: locks
locker.dynamodb.region=us-east-1          # Default: us-east-1
locker.dynamodb.endpoint=<custom-url>     # Optional, for DynamoDB Local
locker.dynamodb.accessKeyId=<key>         # Optional, falls back to default credential chain

Lock Item Schema

lockId (S, PK): "{namespace}:{lockName}"
namespace (S)
lockName (S)
owner (S)
instanceId (S)
leaseDuration (N)
expiry (N, TTL attribute)

Project Updates

  • Added dynamodb Maven profile to root pom.xml
  • Added locker-dynamodb to everything profile
  • Updated GitHub Actions matrix to build DynamoDB variant
  • Created module README with DynamoDB Local setup instructions
  • Updated main README with DynamoDB backend entry

Testing

  • Unit tests with Mockito for error paths
  • DynamoDbLockServiceActualTest extends AbstractLockServiceTest (disabled, for manual testing with DynamoDB Local)
Original prompt

Start implementation

[Chronological Review: The conversation began with the user requesting assistance in crafting business and technical requirements for adding a new database engine (AWS DynamoDB) to the LockServiceCentral repository. The user outlined specific requirements, including the need for conditional write transactions, automatic expiration of locks, environment variable configuration, and logging integration. The user also mentioned updating relevant documentation and ensuring testing coverage. The user then requested to start the implementation, indicating readiness to proceed with the development phase.]

[Intent Mapping:

  • "Help me craft the business / technical requirements for https://github.com/UnitVectorY-Labs/LockServiceCentral to add a new database engine."
  • "The goal here is to follow the conventions of the other database engines that are supported (GCP Firestore and Etcd) and have a separate module that is specifically for AWS's DynamoDB."
  • "The implementation must also support automatic expiration of locks after a configurable timeout period."
  • "This implementation should use that logging library for all logging needs."
  • "Start implementation."]

[Technical Inventory:

  • Technologies: AWS DynamoDB, GCP Firestore, Etcd
  • Frameworks: Logging library for structured logging
  • Architectural Decisions: Separate module for DynamoDB, environment variable configuration for credentials, mocking for unit tests, matrix build in GitHub Actions.]

[Code Archaeology:

  • Files mentioned: README.md (for documentation updates), .github/workflows/docker-build-dev.yml (for matrix build updates).
  • Functions/Classes: Not specified yet, but will include those related to DynamoDB interactions and logging.]

[Progress Assessment:

  • Completed: User has articulated clear requirements for the new DynamoDB module.
  • Pending: Actual implementation of the DynamoDB module, documentation updates, and testing.]

[Context Validation: All critical information for continuation is captured, including specific requirements for the DynamoDB implementation and the need to follow existing conventions.]

[Recent Commands Analysis:

  • Last Agent Commands: User requested to "Start implementation."
  • Tool Results Summary: No specific tool results were generated from this command as it was a user directive.
  • Pre-Summary State: The agent was preparing to transition from requirements gathering to the implementation phase of the DynamoDB module.
  • Operation Context: The user is focused on implementing a new database engine while ensuring it aligns with existing architecture and conventions.]
1. Conversation Overview: - Primary Objectives: User requested help to "craft the business / technical requirements" for adding AWS DynamoDB to the LockServiceCentral repository, ensuring it follows existing conventions and integrates seamlessly. - Session Context: The conversation flowed from requirement gathering to readiness for implementation, with a focus on technical specifications and documentation needs. - User Intent Evolution: The user initially sought detailed requirements and then shifted to initiating the implementation phase.
  1. Technical Foundation:
  • AWS DynamoDB: A NoSQL database service that will be integrated as a new module.
  • Logging Library: Used for structured logging throughout the repository.
  • GitHub Actions: For CI/CD processes, specifically the matrix build for Docker images.
  1. Codebase Status:
  • README.md:
    • Purpose: Document the new DynamoDB module and its configuration.
    • Current State: Needs updates to reflect the new implementation.
  • .github/workflows/docker-build-dev.yml:
    • Purpose: Manage CI/CD for different database implementations.
    • Current State: Requires addition of the DynamoDB module to the build matrix.
  1. Problem Resolution:
  • Issues Encountered: None documented yet; focus is on requirements and implementation.
  • Solutions Implemented: None yet; requirements are being defined.
  • Debugging Context: Not applicable at this stage.
  • Lessons Learned: Importance of following existing conventions and ensuring proper documentation.
  1. Progress Tracking:
  • Completed Tasks: Requirements for the DynamoDB module have been articulated.
  • Partially Complete Work: Implementation of the DynamoDB module is pending.
  • Validated Outcomes: None yet, as implementation has not started.
  1. Active Work State:
  • Current Focus: Transitioning from requirements gathering to implementation of the DynamoDB module.
  • Recent Context: User requested to "Start implementation," indicating readiness to proceed.
  • Working Code: No specific code snippets discussed yet.
  • Immediate Context: Preparing to implement the new DynamoDB module based on defined requirements.
  1. Recent Operations:
  • Last Agent Commands: User requested to "Start implementation."
  • Tool Results Summary: No specific tool results were generated from this command.
  • Pre-Summary State: The agent was preparing...

Created from VS Code.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 28, 2026 02:55
Co-authored-by: JaredHatfield <208119+JaredHatfield@users.noreply.github.com>
Co-authored-by: JaredHatfield <208119+JaredHatfield@users.noreply.github.com>
Co-authored-by: JaredHatfield <208119+JaredHatfield@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

❌ Patch coverage is 8.53659% with 150 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.75%. Comparing base (13e6c4f) to head (cde6a4d).
⚠️ Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
...cecentral/locker/dynamodb/DynamoDbLockService.java 9.33% 134 Missing and 2 partials ⚠️
...locker/dynamodb/LockerAwsDynamoDbClientConfig.java 0.00% 12 Missing ⚠️
...ntral/locker/dynamodb/LockerAwsDynamoDbConfig.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #100      +/-   ##
============================================
- Coverage     44.49%   38.75%   -5.75%     
- Complexity      132      136       +4     
============================================
  Files            28       31       +3     
  Lines           863     1027     +164     
  Branches        105      112       +7     
============================================
+ Hits            384      398      +14     
- Misses          452      600     +148     
- Partials         27       29       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI changed the title [WIP] Add new database engine support for AWS DynamoDB Add DynamoDB backend implementation Jan 28, 2026
Copilot AI requested a review from JaredHatfield January 28, 2026 03:06
Copilot AI and others added 7 commits January 28, 2026 10:41
Co-authored-by: JaredHatfield <208119+JaredHatfield@users.noreply.github.com>
… and fix Javadoc

Co-authored-by: JaredHatfield <208119+JaredHatfield@users.noreply.github.com>
…db-update-logic

Rewrite DynamoDB lock service with atomic conditional expressions
…ing pattern

Co-authored-by: JaredHatfield <208119+JaredHatfield@users.noreply.github.com>
…-logging-method

Remove log.debug() from DynamoDbLockService to follow canonical logging convention
@JaredHatfield JaredHatfield marked this pull request as ready for review January 28, 2026 11:42
@JaredHatfield JaredHatfield merged commit 2a615f9 into main Jan 28, 2026
3 checks passed
@JaredHatfield JaredHatfield deleted the copilot/implement-dynamodb-support branch January 28, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants