The uniform key-value API for SQL and NOSQL databases with Node.js


Seemlessly integrate with one or more databases.

Find Out More

Using Multiple Databases


If multiple databases are configured, the reading and writing behave as if it is a caching system. When writing to RedKV, the key-value pair gets to write to all databases. When getting a key, RedKV sequentially tries a database from the front of the list, moves on to the next database if the key was not found, and stops until the key is found in a database. After that, the key-value pair is filled to all the databases in front of the list, up to the database where the key is actually found, just like filling a cache.

Example: Redis-Cached DynamoDB KV Store
let kvStore = new RedKV();
kvStore.addStore('redis');
kvStore.addStore('dynamodb', {
        region: "us-east-1",
        endpoint: "https://DynamoDB.us-east-1.amazonaws.com",
        tableName:  'dev.calculator'
    });
Documentation

Simple API Returning Promises


.set(key, value)

Sets a key-value pair to the store. Returns a Promise which resolves if succeeded.

.get(key)

Gets a Promise which resolves to the value of the key or null.

.has(key)

Returns a Promise which resolves to a bool indicating if the key exists.

.delete(key)

Deletes the key. Promise resolves after finishing.

Supported databases


Memory

Suggest the next one!

MIT licensed. Download from npm:

npm -i redkv