atomicdb
A comprehensive database engine that works with arbitrary storage solutions and runs guaranteed atomic operations with additional support for encryption and compression
Last updated 3 years ago by ishafayet .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install atomicdb 
SYNC missed versions from official npm registry.

atomicdb

A comprehensive database engine that works with arbitrary storage solutions and runs guaranteed atomic operations with additional support for encryption and compression

NPM

N/B: The code/examples in this file are in coffee-script. Javascript examples are coming soon.

Installation (NodeJS)

npm install atomicdb --save

Usage (NodeJS)

{
  Atomicdb
} = require 'atomicdb'

db = new Atomicdb

Installation (Browser)

Download the latest build and put it in your application.

<script type="text/javascript" src="atomicdb-0.1.8.js"></script>

Features

constructor

new Atomicdb options

options is a object containing the following keys -

  • name A name for the database. Must be unique on your host/domain.

  • storageEngine A storageEngine. Compatible with window.localStorage, window.sessionStorage. You can set your own. A custom storageEngine has to be roughly compatible with the window.localStorage specs. Basically, it needs to implement the functions in window.localStorage such as getItem, setItem, etc. For in-memory operation, we suggest you use memorystorage module by stijndewitt

  • serializationEngine A way to serialize object to string and back. JSON.stringify and JSON.parse is a good example. You can of course set your own. As long as it has the stringify and parse methods, you are golden.

  • commitDelay Guarantees that there will be at least commitDelay miliseconds delay between two subsequent commits. Useful if you have a big database or very frequent database changes. By default it is set to 'none' which commits synchronously.

  • uniqueKey Every document in atomicdb has a unique identifier key that can not be altered by the user/developer. You can specify the name of the unique key. It defaults to _id as in mongodb.

Example:

db = new Atomicdb {
  name: 'test-db'
  storageEngine: localStorage
  serializationEngine: JSON
  commitDelay: 'none'
  uniqueKey: '_id'
}

Current Tags

  • 0.1.8                                ...           latest (3 years ago)

7 Versions

  • 0.1.8                                ...           3 years ago
  • 0.1.7                                ...           3 years ago
  • 0.1.6                                ...           3 years ago
  • 0.1.4                                ...           3 years ago
  • 0.1.3                                ...           3 years ago
  • 0.1.2                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (1)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |