# ueberDB

> transform every database into a object key value store

Latest version **0.2.16** (published 2015-05-01) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install ueberDB
pnpm add ueberDB
yarn add ueberDB
bun add ueberDB
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.16 |
| Published | 2015-05-01 |
| First published | 2011-05-14 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 273 |
| Author | Etherpad Foundation |
| Maintainers | pita, johnyma22 |
| Keywords | database, keyvalue |

## Links

- npm: https://www.npmjs.com/package/ueberDB
- Repository: http://github.com/pita/ueberDB
- Homepage: https://github.com/pita/ueberDB
- Issues: https://github.com/pita/ueberDB/issues
- npm.io page: https://npm.io/package/ueberDB

## Dependencies (9)

- [pg](https://npm.io/package/pg.md) 4.3.0
- [nano](https://npm.io/package/nano.md) ^6.1.2
- [async](https://npm.io/package/async.md) 0.1.15
- [dirty](https://npm.io/package/dirty.md) 0.9.x
- [mysql](https://npm.io/package/mysql.md) 2.6.1
- [redis](https://npm.io/package/redis.md) >=0.12.1
- [channels](https://npm.io/package/channels.md) 0.0.4
- [elasticsearch](https://npm.io/package/elasticsearch.md) 4.0.2
- [cassandra-driver](https://npm.io/package/cassandra-driver.md) 2.0.1

## Recent versions

- 0.2.16 (latest) — 2015-05-01
- 0.2.15 — 2015-04-06
- 0.2.14 — 2015-03-22
- 0.2.13 — 2015-03-02
- 0.2.12 — 2015-02-26
- 0.2.11 — 2015-01-21
- 0.2.10 — 2015-01-12
- 0.2.9 — 2014-11-06
- 0.2.8 — 2014-11-03
- 0.2.7 — 2014-11-01
- 0.2.6 — 2014-10-30
- 0.2.5 — 2014-10-30
- 0.2.4 — 2014-10-29
- 0.2.3 — 2014-10-14
- 0.2.2 — 2014-05-21
- … 33 more at https://npm.io/package/ueberDB/versions

## README

#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

```javascript
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](http://www.apache.org/licenses/LICENSE-2.0.html)

---
_Source: https://npm.io/package/ueberDB · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
