🪦 Redis Key Value store backed by IPFS

Overview

🪦 RipDB 🪦
A snappy, decentralized JSON store perfect for fast moving web3 builders.
Redis + IPFS = RIP = 😍

Install

With a Package Manager (browser or node.js)

npm install --save @rip-db/client

# or with yarn
yarn add @rip-db/client

With a Script Tag

<script type="module">
  import { RipDBClient } from 'https://rip-db.storage.googleapis.com/rip-client.es-browser1.0.12.js';

  const ripServerUrl = ...

  ... see quick start guide below
</script>

Quick Start

The quickest way to test out rip-db is with the rip sandbox server (example below). If you want to run a production instance of rip, see the running your own server section.

import { RipDBClient } from '@rip-db/client';

// Quickstart guide here
const ripServerUrl = 'https://rip-sandbox.onrender.com';

const rip = new RipClient({ ripServerUrl });

...

// See encryption section below on how to anable encryption
const myJson = { hello: 'RIP world' };
await rip.set('myJsonKey', myJson, { encrypt: false });

...

const { data } = await rip.get('myJsonKey');

...

// reclaims memory, but preserves data on IPFS
await rip.purge('myJsonKey');

☠️ simple or what?

Speed

Demo

See the speed for yourself on the rip demo site.

Motivation

The SQL database is a powerful tool unrivaled for storing and querying relational data.

BUT, I believe most dapps can live without a traditional SQL database in favor of something more light weight and decentralized.

Here are some problems with setting up a db for your dapp

  1. There are already many great services which index blockchain data (why reinvent the wheel?)
  2. DBs are expensive to host
  3. Migrations are often a pain
  4. They tend to be centralized / treasure trove for attackers
  5. They usually don't give users provenance over their data
  6. Encryption / key management is a pain

Many web3 developers choose to store their data as JSON directly on IPFS rather than a traditional DB, but IPFS upload times can be slow and gateway timeouts are brutal.

If a traditional db seems overkill for your use case, and interacting directly with IPFS seems a bit too slow, RIP might be for you.

It gives you the speed of in memory cache (redis) but the decentralization of a global network (Filecoin + IPFS), with some ther goodies like encryption.

E2E Encryption

Rip offers easy E2E encryption for user data via lit protocol. In order to use encryption you will need to install the lit javascript sdk.

Via Package Manager

> npm install lit-js-sdk

Via Script Tag

<script
  onload="LitJsSdk.litJsSdkLoadedInALIT()"
  src="https://jscdn.litgateway.com/index.web.js"
></script>

Using Encryption with Rip Client

const ripServerUrl = 'https://rip-sandbox.onrender.com';

// Enable encryption during client initialization
// Rip will automatically use lit-js-sdk for encryption
const rip = new RipClient({ ripServerUrl, enableEncryption: true });

...

// you need a one time wallet signature to
// prove identity for encryption and decryption
await rip.signMessageForEncryption()

...

// make sure to pass encrypt: true option
const myJson = { hello: 'Encrypted RIP world' };
await rip.set('myJsonKey', myJson, { encrypt: true });

...

// rip automatically decrypts
const { data } = await rip.get('myJsonKey');

Running your own Rip Server

For now, if you want to use rip in production, you will need to run your own rip server instance.

⚠️ ⚠️ !! We can help you get a server instance up and running !! ⚠️ ⚠️

If you would like help from the team behind rip-db getting a production instance up and running, please join our discord

discord

Instructions for hosting Rip Server

If you want to run a rip instance on your own follow the below instructions

Prep

  1. Install and run redis (documentation here. You can run on your local or a cloud service of your choice.
  2. Acquire an NFT Storage API Key (found here)
  3. Clone the repo git clone https://github.com/zdenham/redis-ipfs.git

Install Dependencies

> yarn install
> cd server
> yarn install

Set Environment Variables:

NOTE: you can see the redis URI syntax here

Under /server directory if you are using a .env file.

REDIS_URL=redis://[[username:]password@]host[:port][/database]
IPFS_KEY=[YOUR_NFT STORAGE_KEY]

Under your environment variables you will need to set IPFS

Start The Server

> yarn start

Point Your Rip Client to the Server

Once your server is live, you can point your rip client to the server by initializing it with ripServerUrl that points to your server instance url.

Contributing

If you have any interest in contributing to RIP, please join our discord and we can help you get started with a starter task. Also feel free to contact me at [email protected]

discord

You might also like...

Serve read-only Redis data over a HTTP API with auth

Redis data exposer This was created for Cliptok and not intended for use outside of it. Use at your own peril. This application will serve an API that

May 28, 2022

This project demonstrates how you can use the multi-model capabilities of Redis to create a real-time stock watchlist application.

This project demonstrates how you can use the multi-model capabilities of Redis to create a real-time stock watchlist application.

Introduction This project demonstrates how you can use Redis Stack to create a real-time stock watchlist application. It uses several different featur

Jan 2, 2023

Full type-safe Redis PubSub with Zod

redis-pubsub Full type-safe Redis PubSub system with async iterators Features Type-safety with Zod Out-of-the-box support for Date/Map/Set/BigInt seri

Dec 21, 2022

Cache is easy to use data caching Node.js package. It supports Memcached, Redis, and In-Memory caching engines.

Cache Cache NPM implements wrapper over multiple caching engines - Memcached, Redis and In-memory (use with single threaded process in development mod

Oct 24, 2022

An open-source link shortener built with Vercel Edge Functions and Upstash Redis.

Dub An open-source link shortener built with Vercel Edge Functions and Upstash Redis. Introduction · Deploy Your Own · Contributing Introduction Dub i

Jan 5, 2023

Cloudflare Worker that will allow you to progressively migrate files from an S3-compatible object store to Cloudflare R2.

A Cloudflare Worker for Progressive S3 to R2 Blog Post: https://kian.org.uk/progressive-s3-to-cloudflare-r2-migration-using-workers/ This is a Cloudfl

Dec 30, 2022

Store and Deliver images with R2 backend Cloudflare Workers.

Store and Deliver images with R2 backend Cloudflare Workers.

r2-image-worker Store and Deliver images with Cloudflare R2 backend Cloudflare Workers. Synopsis Deploy r2-image-worker to Cloudflare Make a base64 st

Jan 3, 2023

jStorage is a simple key/value database to store data on browser side

NB! This project is in a frozen state. No more API changes. Pull requests for bug fixes are welcomed, anything else gets most probably ignored. A bug

Dec 10, 2022

Bookmate - Watch changes in Chrome bookmarks, and use bookmarks as an append-only key-value store via an fs-like API.

📗 Bookmate An append-only key-value store built on Chrome bookmarks, plus an asychronous stream of Bookmark changes. For NodeJS Actual production exa

Nov 8, 2022

Kue is a priority job queue backed by redis, built for node.js.

Kue Kue is no longer maintained Please see e.g. Bull as an alternative. Thank you! Kue is a priority job queue backed by redis, built for node.js. PRO

Dec 20, 2022

A simple, fast, robust job/task queue for Node.js, backed by Redis.

A simple, fast, robust job/task queue for Node.js, backed by Redis.

A simple, fast, robust job/task queue for Node.js, backed by Redis. Simple: ~1000 LOC, and minimal dependencies. Fast: maximizes throughput by minimiz

Jan 5, 2023

Redis-backed task queue engine with advanced task control and eventual consistency

idoit Redis-backed task queue engine with advanced task control and eventual consistency. Task grouping, chaining, iterators for huge ranges. Postpone

Dec 15, 2022

🪐 The IPFS gateway for NFT.Storage is not "another gateway", but a caching layer for NFTs that sits on top of existing IPFS public gateways.

nftstorage.link The IPFS gateway for nft.storage is not "another gateway", but a caching layer for NFT’s that sits on top of existing IPFS public gate

Dec 19, 2022

RedisInsight - Developer GUI for Redis, by Redis.

RedisInsight - Developer GUI for Redis, by Redis.

RedisInsight - Developer GUI for Redis, by Redis. RedisInsight is a visual tool that provides capabilities to design, develop and optimize your Redis

Dec 31, 2022

Realm is a mobile database: an alternative to SQLite & key-value stores

Realm is a mobile database that runs directly inside phones, tablets or wearables. This project hosts the JavaScript versions of Realm. Currently we s

Jan 3, 2023

Simple key-value storage with support for multiple backends

Simple key-value storage with support for multiple backends Keyv provides a consistent interface for key-value storage across multiple backends via st

Jan 7, 2023

JS / CSS / files loader + key/value storage

bag.js - JS / CSS loader + KV storage bag.js is loader for .js / .css and other files, that uses IndexedDB/ WebSQL / localStorage for caching. Conside

Nov 28, 2022

Byteroo - Key-value storage for your Node.js applications

Byteroo Byteroo is a key-value storage for your Node.js applications. Usage: const Byteroo = require('byteroo'); const storage = new Byteroo({ name:

Jan 3, 2022
Comments
  • Is there any benchmark data for this db?

    Is there any benchmark data for this db?

    I found this project from HackFS. It's fantastic! I didn't dive too much into the code yet and will do that later. Do you guys have some benchmark results compared to other key-value databases? That would be very helpful!

    opened by forrestchang 3
A simple, fast, robust job/task queue for Node.js, backed by Redis.

A simple, fast, robust job/task queue for Node.js, backed by Redis. Simple: ~1000 LOC, and minimal dependencies. Fast: maximizes throughput by minimiz

Bee Queue 3.1k Jan 5, 2023
Redis-backed task queue engine with advanced task control and eventual consistency

idoit Redis-backed task queue engine with advanced task control and eventual consistency. Task grouping, chaining, iterators for huge ranges. Postpone

Nodeca 65 Dec 15, 2022
Redis Simple Message Queue

Redis Simple Message Queue A lightweight message queue for Node.js that requires no dedicated queue server. Just a Redis server. tl;dr: If you run a R

Patrick Liess 1.6k Dec 27, 2022
BullMQ - Premium Message Queue for NodeJS based on Redis

The fastest, most reliable, Redis-based distributed queue for Node. Carefully written for rock solid stability and atomicity. Read the documentation F

Taskforce.sh Inc. 3.1k Dec 30, 2022
Nodejs Background jobs using redis.

node-resque: The best background jobs in node. Distributed delayed jobs in nodejs. Resque is a background job system backed by Redis (version 2.6.0 an

Actionhero 1.2k Jan 3, 2023
A simple high-performance Redis message queue for Node.js.

RedisSMQ - Yet another simple Redis message queue A simple high-performance Redis message queue for Node.js. For more details about RedisSMQ design se

null 501 Dec 30, 2022
A fast, robust and extensible distributed task/job queue for Node.js, powered by Redis.

Conveyor MQ A fast, robust and extensible distributed task/job queue for Node.js, powered by Redis. Introduction Conveyor MQ is a general purpose, dis

Conveyor MQ 45 Dec 15, 2022
egg.js(jwt) + mysql(sequelize) + redis + docker + docker-compose + nginx + vue + element-ui 全栈获取省市区数据(统计局数据)【工具】项目,实现在docker环境中一键部署

Egg-spider Preview 线上预览地址 (https://ronaldoxzb.com/) admin admin Project description [后端]egg.js(jwt) + mysql(sequelize) + redis + docker + docker-compo

null 11 Sep 29, 2022
Serverless URL Shortener made with Next.js + Redis.

linki: a place for your links linki is a url shortener made with next.js and redis! built with simplicity in mind, it's all in one page. deploy your o

Jack Reiker 12 Sep 15, 2022
A simple Node.js APIBAN client for downloading banned IPs and inserting them into a redis set

apiban-redis A simple Node.js APIBAN client for downloading banned IPs and inserting them into a redis set. Installation This utility can be run as a

jambonz 4 Apr 5, 2022