Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.
/ immutabledb Public archive

Interface for content-addressed storage as a database

License

Notifications You must be signed in to change notification settings

haadcode/immutabledb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ImmutableDB

ImmutableDB is an interface for content-addressed storage systems as databases.

Table of Contents

Specification

ImmutableDB is specified as:

  1. same data always returns the same key (write)
  2. same key always returns the same data (read)

The difference to traditional relational databases, document databases or key-value stores is that the key doesn't get specified explicitly by the user. Instead, the key gets calculated based on the data using a hashing function. This is also called content-addressed storage.

In practice this means that saving hello world to an ImmutableDB will always return key abc regardless of which instance or location the data is saved at and saving hello world! will return cba. In turn, querying the value of key abc will always return hello world, regardless of instance and location.

Interface

put (value)

Save value to database and return a key.

Example:

var key = put("hello world")
console.log(key)
// "abc"

get (key)

Retrieve the value of key from the database.

Example:

var data = get("abc")
console.log(data)
// "hello world"

Implementations

ImmutableDB can be used via the following implementations:

Contribute

New backend implementations, PRs and discussion are gladly accepted!

License

MIT © 2017 Haad

About

Interface for content-addressed storage as a database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published