# dynamodb-recs

> ### 1. Config Lambda Code

Latest version **1.0.38** (published 2021-02-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install dynamodb-recs
pnpm add dynamodb-recs
yarn add dynamodb-recs
bun add dynamodb-recs
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.38 |
| Published | 2021-02-12 |
| First published | 2019-12-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 87.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | feliperohde |

## Links

- npm: https://www.npmjs.com/package/dynamodb-recs
- npm.io page: https://npm.io/package/dynamodb-recs

## Dependencies (7)

- [joi](https://npm.io/package/joi.md) ^17.4.0
- [rxjs](https://npm.io/package/rxjs.md) 6.6.3
- [lodash](https://npm.io/package/lodash.md) ^4.17.20
- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.841.0
- [graphed](https://npm.io/package/graphed.md) ^1.0.20
- [simple-beauty-error](https://npm.io/package/simple-beauty-error.md) ^1.0.1
- [rxjs-dynamodb-client](https://npm.io/package/rxjs-dynamodb-client.md) ^2.0.4

## Recent versions

- 1.0.38 (latest) — 2021-02-12
- 1.0.37 — 2021-02-12
- 1.0.36 — 2021-02-11
- 1.0.35 — 2021-02-11
- 1.0.34 — 2021-02-11
- 1.0.33 — 2021-02-11
- 1.0.31 — 2021-02-11
- 1.0.30 — 2021-02-11
- 1.0.29 — 2021-01-08
- 1.0.28 — 2021-01-07
- 1.0.27 — 2021-01-07
- 1.0.26 — 2021-01-05
- 1.0.25 — 2020-10-13
- 1.0.24 — 2020-08-12
- 1.0.23 — 2020-03-06
- … 23 more at https://npm.io/package/dynamodb-recs/versions

## README

## AWS Dynamodb/Firehose Based Reccomendation Engine Based on Graphs.

### 1. Config Lambda Code

    const {
        App,
        handlers
    } = require('dynamodb-recs');

    const app = new App({
        logs: { // optional
            firehose: { // optional
                concurrency: 100,
                stream: 'app-recs-logs'
            },
            process: { // optional
                concurrency: 100,
                offset: 60 * 60 * 1000 // 1 hour
            },
            ttl: 24 * 60 * 60 * 1000 // 1 day optional
        },
        recs: {
            firehose: { // optional
                concurrency: 100,
                stream: 'app-recs'
            },
            jobs: {
                viewView: [{
                    entity: 'view'
                }, {
                    entity: 'view'
                }]
            },
            ttl: 2 * 365 * 24 * 60 * 60 * 1000, // 2 years optional
            ttr: 30 * 60 * 1000 // 30 minutes optional
        },
        tablePrefix: 'prefix' // optional
    });

    exports.fetch = handlers.fetch(app);
    exports.logsFirehose = handlers.logsFirehose(app);
    exports.logsHit = handlers.logsHit(app);
    exports.logsProcess = handlers.logsProcess(app);
    exports.recsFirehose = handlers.recsFirehose(app);

### 2. Config Lambda Handlers

    Name
    app-recs-fetch

    Handler
    index.fetch

    Size
    3008 MB

    -

    Name
    app-recs-firehose

    Handler
    index.recsFirehose

    Size
    512 MB

    -

    Name
    app-recs-logs-firehose

    Handler
    index.logsFirehose

    Size
    512 MB

    -

    Name
    app-recs-logs-hit

    Handler
    index.logsHit

    Size
    128 MB

    -

    Name
    app-recs-logs-process

    Handler
    index.logsProcess

    Size
    512 MB

### 3. Config Kinesis Firehose
    
    Name
    app-recs

    Lambda Transformer
    app-recs-firehose

    S3 Bucket
    app

    Prefix
    recs/dt=!{timestamp:yyyy}-!{timestamp:MM}-!{timestamp:dd}/
    
    Error prefix
    recs-error/err=!{firehose:error-output-type}/dt=!{timestamp:yyyy}-!{timestamp:MM}-!{timestamp:dd}/

    -

    Name
    app-recs-logs

    Lambda Transformer
    app-recs-logs-firehose

    S3 Bucket
    app

    Prefix
    recs-logs/dt=!{timestamp:yyyy}-!{timestamp:MM}-!{timestamp:dd}/
    
    Error prefix
    recs-logs-error/err=!{firehose:error-output-type}/dt=!{timestamp:yyyy}-!{timestamp:MM}-!{timestamp:dd}/

### 5. Config CloudWatch to Process Logs from Time to Time

    Period
    Each 30 minutes

    Lambda
    app-recs-logs-process

    Body
    `{}`

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