Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adds TableBuilder, which can be used to prepopulate the internal metadata cache used by the document and object-mapper DynamoDB programming models #3055

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

ashovlin
Copy link
Member

Description

This is an approach that partially addresses #1476.

Users can use the new TableBuilder to populate the internal SDK cache of table structures that drive the DynamoDB document and object-mapper programming models.

  • Document: Instead of Table.Load, call new TableBuilder().<table info>.Build()
  • Object mapper: Call context.RegisterTableDefinition(<Table>);

Looking for feedback on: The SDK uses "hash"/"range" in existing structures, as opposed to "partition"/"sort" key, which seem to be used more heavily in DynamoDB documentation. Let me know your thoughts on naming for public methods and arguments in ITableBuilder.

Motivation and Context

This allows users to pre-populate the internal cache, which prevents the internal DescribeTable call the SDK makes. This avoids the sync-over-async issues discussed in #1476.

Testing

  • Added unit tests exercising the new TableBuilder
  • Duplicated existing document and object-mapper tests that test CRUD and scan/query operations, but replaced the initialization with the TableBuilder

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed

License

  • I confirm that this pull request can be released under the Apache 2 license

@normj
Copy link
Member

normj commented Sep 20, 2023

Looking for feedback on: The SDK uses "hash"/"range" in existing structures, as opposed to "partition"/"sort" key, which seem to be used more heavily in DynamoDB documentation. Let me know your thoughts on naming for public methods and arguments in ITableBuilder.

My take is the service client uses hash/range we should stay consistent with that. Makes it easier to switch between the different levels of APIs in the SDK if we stay consistent with our selves.

…l metadata cache used by the document and object-mapper DynamoDB programming models
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.

4 participants