ueberDB

transforms every database into a object key value store, written in node.js

  • 所有者: ether/ueberDB
  • 平台:
  • 許可證: Apache License 2.0
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

About

Abstract your databases, make datababies. ueberDB turns every database into a simple key value store by providing a layer of abstraction between your software and your database. ueberDB uses a smart cache and buffer algorithm to make databases faster. Reads are cached and writes are done in a bulk. The bulk writing reduces the overhead of a database transaction. The syntax is simple and clean and getting started is easy.

Database Support

  • Couch
  • Crate
  • Dirty
  • Elasticsearch
  • Level
  • Mongo
  • MySQL (<= 5.7)
  • Postgres
  • Redis
  • RethinkDB
  • SQLite

Install

npm install ueberDB

Example

var ueberDB = require("ueberDB");

//mysql
var db = new ueberDB.database("mysql", {"user":"root", host: "localhost", "password":"", database: "store"});
//sqlite in-memory
//var db = new ueberDB.database("sqlite");
//sqlite in file
//var db = new ueberDB.database("sqlite", {filename:"var/sqlite3.db"});
//sqlite in file with a write interval of a half second
//var db = new ueberDB.database("sqlite", {filename:"var/sqlite3.db"}, {writeInterval: 500});

//initialize the database
db.init(function (err)
{
  if(err)
  {
    console.error(err);
    process.exit(1);
  }

  //set a object as a value
  //can be done without a callback, cause the value is immediately in the buffer
  db.set("valueA", {a:1,b:2});

  //get the object
  db.get("valueA", function(err, value){
    console.log(value);

    db.close(function(){
      process.exit(0);
    });
  });
});

How to add support for another database

Look at sqlite_db.js and mysql_db.js, your module have to provide the same functions. Call it DATABASENAME_db.js and reimplement the functions for your database. If you think it works, test it with node benchmark.js DATABASENAME. Benchmark.js is benchmark and test at the same time. It tries to set 100000 values. You can pipe stderr to a file and will create a csv with benchmark results.

Limitations

Only mysql, dirty, mongodb, couch, rethink and crate currently support findKeys feature. The following do not yet support the function:

  • leveldb
  • redis (Only keys of the format *:*:*)
  • cassandra (Only keys of the format *:*:*)
  • elasticsearch (Only keys of the format *:*:*)

For details on how it works please refer to the wiki: https://github.com/Pita/ueberDB/wiki/findKeys-functionality

License

Apache License v2

主要指標

概覽
名稱與所有者ether/ueberDB
主編程語言TypeScript
編程語言JavaScript (語言數: 2)
平台
許可證Apache License 2.0
所有者活动
創建於2011-05-08 15:06:29
推送於2025-05-26 13:58:20
最后一次提交
發布數236
最新版本名稱v5.0.13 (發布於 2025-04-08 17:50:20)
第一版名稱v1.0.3 (發布於 2020-12-29 11:55:40)
用户参与
星數268
關注者數19
派生數95
提交數1.3k
已啟用問題?
問題數66
打開的問題數1
拉請求數518
打開的拉請求數6
關閉的拉請求數263
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?