1.12.0 • Published 2 years ago

dynamodb-abstract-repository v1.12.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

DynamoDB Abstract Repository

Create repositories with custom indexation for easy lookup and hierarchy filter queries.

Out-of-the-box features:

  • Custom lookup and hierarchy filter index with support for complex projections
  • Automatically queries the required indexes based in the parameters provided in the item retrieval request
  • Optimistic Locking with Version Number
  • Enable / disable item overwrite
  • Declarative expression builder for condition, projection and update expressions
  • Custom counters update actions on entity create, update and delete

Considerations

This implementation does not uses DynamoDB secondary indexes (LSI/GSI) for indexing and querying. It manually creates the index entries in the same table as the item using a transaction. Also, it does not performs updates using the UpdateItem operation, so in all updates you must provide the entire item - you must get the item, modify it and then save it.

Advantages:

  • Indexation strategies more flexible than LSI/GSI
  • Easy to use, understand and maintain: no need to roll custom indexation strategies or write multiple commands to retrieve items based on indexes
  • Simpler item update and consistent repository structure

Disadvantages

  • The write operations is not optimized for cost as we use transactions and do not supports UpdateItem opreations
  • The use of transactions for synchronous indexation increase the latency, as the TransactionWrite operation is far slower than PutItem operation

Next Steps

We're currently extensively testing the library and planning library interfaces improvements for the next releases

Installation

$ npm install dynamodb-abstract-repository

see on npm

Author

William Tutihashi

1.12.0

2 years ago

1.11.0

2 years ago

1.10.0

2 years ago

1.9.0

2 years ago

1.8.0

2 years ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago