0.5.0 • Published 1 year ago

serverless-dynalite2-local v0.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

serverless-dynalite-local

Serverless plugin to run DynamoDB locally with dynalite.

Motivation

When developing services in the Serverless Application Framework, it is common to use the serverless-offline plugin for local development. This plugin will enable you to run a local instance of DynamoDB, dynalite as well.

There are already some plugins out there that serves the same purpose, but they have some challenges.

  • serverless-dynamodb-local has a hard dependency on JRE, and is created to download the DynamoDB *.jar file before starting. While this might work on a local developer computer, it does not in a CI/CD environment. In addition, the serverless plugin does not support v2 and up.
  • serverless-dynalite comes with node-only dependencies, but has been unmaintained for a while and does not work on newer node runtimes.

We have, therefore, decided to create a new plugin which overcome the challenges from the above two plugins. We also have taken inspiration from serverless-s3-local, which does the same for AWS S3 with s3rver.

Usage

Install the plugin with yarn add --dev serverless-dynalite-local. Add serverless-dynalite-local to your serverless.yml plugins key, BEFORE serverless-offline.

By default the server will start up at http://localhost:4567 and use dynalite/ as a data directory. Connect to the database like this:

const client = new DynamoDBClient({
  endpoint: "http://localhost:4567",
});

The following options are supported in custom.dynalite in serverless.yml:

OptionDescriptionTypeDefault value
portThe port to listen onnumber4567
pathThe path to use for the LevelDB storestring./dynalite
inMemoryWhether to only store data in memory (the path option will be ignored if this is true)booleanfalse

Future plans

In it's current state, this plugin is very much untested in real use cases. The top priority is to make sure this works in actual use cases.

Next up is to improve the documentation and also explain how the underlying dynalite server can be used to run unit tests in Node.js projects.

In addition to this, we should make the plugin a little more configurable, and add some CI/CD for running tests, lint checks, and deployment.

I want to contribute to this library

Please see CONTRIBUTING.md.

0.5.0

1 year ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.6

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.4.2

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago