# @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.

Latest version **2.0.0** (published 2021-10-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tradle/dynamodb
pnpm add @tradle/dynamodb
yarn add @tradle/dynamodb
bun add @tradle/dynamodb
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2021-10-06 |
| First published | 2021-09-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 16 |
| Unpacked size | 236.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Mark Vayngrib |
| Maintainers | leichtgewicht, genevayngrib, tenaciousmv, pgmemk |

## Links

- npm: https://www.npmjs.com/package/@tradle/dynamodb
- Repository: https://github.com/tradle/dynamodb
- Homepage: https://github.com/tradle/dynamodb#readme
- Issues: https://github.com/tradle/dynamodb/issues
- npm.io page: https://npm.io/package/@tradle/dynamodb

## Dependencies (16)

- [co](https://npm.io/package/co.md) ^4.6.0
- [pify](https://npm.io/package/pify.md) ^3.0.0
- [clone](https://npm.io/package/clone.md) ^2.1.1
- [debug](https://npm.io/package/debug.md) ^2.6.8
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [bindall](https://npm.io/package/bindall.md) ^2.0.1
- [error-ex](https://npm.io/package/error-ex.md) ^1.3.1
- [traverse](https://npm.io/package/traverse.md) ^0.6.6
- [array-sort](https://npm.io/package/array-sort.md) ^1.0.0
- [event-hooks](https://npm.io/package/event-hooks.md) ^1.2.0
- [@tradle/errors](https://npm.io/package/@tradle/errors.md) ^2.0.0
- [@tradle/dynogels](https://npm.io/package/@tradle/dynogels.md) ^8.0.1
- [fast-levenshtein](https://npm.io/package/fast-levenshtein.md) ^2.0.6
- [@tradle/constants](https://npm.io/package/@tradle/constants.md) ^2.0.0
- [@tradle/aws-common-utils](https://npm.io/package/@tradle/aws-common-utils.md) ^2.0.0
- [@aws/dynamodb-expressions](https://npm.io/package/@aws/dynamodb-expressions.md) ^0.4.0

## Recent versions

- 2.0.0 (latest) — 2021-10-06
- 1.0.2 — 2021-09-03
- 1.0.1 — 2021-09-03

## 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.

---
_Source: https://npm.io/package/@tradle/dynamodb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
