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

Add secondary indexing via partiton key support #5

Merged
merged 10 commits into from
Aug 19, 2022

Conversation

Rooster212
Copy link
Owner

@Rooster212 Rooster212 commented Aug 18, 2022

This is a breaking change.

Secondary indexing can be achieved in a few ways in DynamoDB - GSIs/LSIs are the most common way of achieving this.

An efficient way to use table capacity is to use single table design patterns and write data in different formats depending on the read use cases (For example: https://aws.amazon.com/blogs/compute/creating-a-single-table-design-with-amazon-dynamodb/)

Following a pattern I have used previously, I've added support for adding secondary indexes via another ID, which is then supported via a separate query method to make it more transparent to the end user.

  • Converted the existing examples into integration tests so that they run in CI.
  • Updated a lot of the comments into JSDoc comments so that they appear in IDEs properly.
  • Move integration test helpers into their own file (as I was using them in multiple places)

@Rooster212 Rooster212 merged commit 95ff802 into master Aug 19, 2022
@Rooster212 Rooster212 deleted the secondary-indexing branch August 19, 2022 13:25
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.

1 participant