Skip to content
This repository

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

branch: master

bump v

latest commit f15eaa8c2f
John McLear JohnMcLear authored
Octocat-spinner-32 var first commit May 08, 2011
Octocat-spinner-32 .gitignore Added leveldb store to gitignore July 22, 2012
Octocat-spinner-32 CONTRIBUTING.md Contributing guidelines October 14, 2012
Octocat-spinner-32 CacheAndBufferLayer.js Buffer should be per instance October 11, 2013
Octocat-spinner-32 CloneAndAtomicLayer.js Code cleanup and minor bugfixes. January 09, 2013
Octocat-spinner-32 LICENSE first commit May 08, 2011
Octocat-spinner-32 README.md Added support for Cassandra. March 21, 2013
Octocat-spinner-32 benchmark.js move default test settings into seperate file December 10, 2011
Octocat-spinner-32 caseSensitiveTest.js Fixed the case sensitive problem of mysql December 10, 2011
Octocat-spinner-32 cassandra_db.js (CassandraCQL2) Add cqlVersion 2.0.0 for cassandra driver November 25, 2013
Octocat-spinner-32 couch_db.js bulk fetch of the revisions January 20, 2012
Octocat-spinner-32 defaultTestSettings.js (CassandraCQL2) Add cqlVersion 2.0.0 for cassandra driver November 25, 2013
Octocat-spinner-32 dirty_db.js added call dirty db close function - dirty 0.9.9 January 29, 2014
Octocat-spinner-32 findKeysTest.js adjusted findKeysTest to work with results in different order March 05, 2013
Octocat-spinner-32 leveldb_db.js Fix LevelDB indentation January 10, 2013
Octocat-spinner-32 lmdb_db.js Adds lmdb support October 23, 2013
Octocat-spinner-32 mongodb_db.js Select only key field in mongo.find function (for findKeys) September 17, 2013
Octocat-spinner-32 mysql_db.js Commit for mysql findKeys February 17, 2013
Octocat-spinner-32 package.json bump v March 13, 2014
Octocat-spinner-32 postgres_db.js Merge pull request #28 from Pita/master January 15, 2013
Octocat-spinner-32 randomAccessTest.js move default test settings into seperate file December 10, 2011
Octocat-spinner-32 redis_db.js Update redis_db.js July 11, 2013
Octocat-spinner-32 sqlite_db.js Implemented findKeys for SQLite, updated README.md January 27, 2013
README.md

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

  • MySQL
  • SQLite
  • Postgres
  • Level
  • Dirty
  • Mongo
  • Redis
  • Couch
  • Cassandra

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 and mongodb currently support findKeys feature. The following do not yet support the function:

  • couch
  • leveldb
  • redis (Only keys of the format ::*)
  • cassandra (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

Something went wrong with that request. Please try again.