https://github.com/tradle/dynamodb
https://github.com/tradle/dynamodb
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tradle/dynamodb
- Owner: tradle
- Created: 2017-07-17T14:15:56.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-10-06T08:13:51.000Z (over 4 years ago)
- Last Synced: 2025-08-17T02:19:30.301Z (10 months ago)
- Language: TypeScript
- Size: 1.47 MB
- Stars: 2
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @tradle/dynamodb
tl;dr: define models for your data with different primary keys and indexes, throw them all in one DynamoDB table, and get efficient querying out of the box.
## Purpose
We created this ORM tool at Tradle to achieve several goals with DynamoDB:
- index an arbitrary number of models according whatever properties make sense for each one individually, all in one table (we use "index overloading")
- be able to easily re-index all resources for a given model if the model changes ("index overloading" to the rescue again)
- be able to create a table first and design data models later. Otherwise you really have to get it right the first time!
## Usage
See an [example](./src/example.ts)
## Trade-offs
Your *table*'s primary keys and indexes are shared across all models. Based on what you choose as primary keys and indexes per *model*, those properties will get stored in duplicate: as properties of the object iself, as well as projected into the table's overloaded primary keys and indexes.