0.2.16 • Published 9 years ago

ueberDB v0.2.16

Weekly downloads
454
License
-
Repository
-
Last release
9 years ago

#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
  • Elasticsearch

#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 and couch 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

0.2.16

9 years ago

0.2.15

9 years ago

0.2.14

9 years ago

0.2.13

9 years ago

0.2.12

9 years ago

0.2.11

9 years ago

0.2.10

9 years ago

0.2.9

9 years ago

0.2.8

10 years ago

0.2.7

10 years ago

0.2.6

10 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

11 years ago

0.1.96

11 years ago

0.1.95

11 years ago

0.1.94

11 years ago

0.1.93

11 years ago

0.1.92

11 years ago

0.1.91

11 years ago

0.1.9

11 years ago

0.1.8

12 years ago

0.1.7

12 years ago

0.1.6

12 years ago

0.1.5

12 years ago

0.1.4

12 years ago

0.1.3

12 years ago

0.1.2

13 years ago

0.1.1

13 years ago

0.1.0

13 years ago

0.0.15

13 years ago

0.0.14

13 years ago

0.0.13

13 years ago

0.0.12

13 years ago

0.0.11

13 years ago

0.0.10

13 years ago

0.0.9

13 years ago

0.0.8

13 years ago

0.0.7

13 years ago

0.0.6

13 years ago

0.0.5

13 years ago

0.0.4

13 years ago

0.0.3

13 years ago

0.0.2

13 years ago

0.0.1

13 years ago