Skip to content

heineiuo/rippledb

Repository files navigation

Rippledb is an embeddable key-value database engine in pure TypeScript, based on LSM-Tree, Inspired by LevelDB.

  • Pure TypeScript: Rippledb is totally written in TypeScript, and runs on different platforms after being compiled to JavaScript.
  • Lightweight: Rippledb has only 7k+ source code, and smaller than 1MB after compiled.Rippledb use zero third party modules.
  • Embeddable: Rippledb can be embedded in node.js application (or other JavaScript Runtime Environments) very easily.

Installation

Install with npm:

npm install rippledb

Install with Yarn:

yarn add rippledb

Documentation

You can find the React documentation on the website.

Check out the Get Started page for a quick overview.

Examples

import path from 'path'
import { Database } from 'rippledb'

async function main(){
  const db = new Database(path.resolve(__dirname, './db'))
  await db.put('foo', 'bar')
  console.log(
    new TextDecoder().decode(await db.get('foo'))
  ) // 'bar'
}

main()

Roadmap

  • Release 1.0 (2020-7-7)
  • Support Deno (2020-9-1)

Benchmark

environment : GitHub Action
key         : 16 bytes
value       : 100 bytes
total       : 10000
runners     : 10 
fillrandom  : 823.87 ms total; 82.39 us/op

Compatibility

node.js Deno
>=v10.0.0 WIP

License

MIT License