An interface for immutable databases
ImmutableDB is an abstract interface for content-addressed databases that:
- save the same blob of data to the same key every time (write)
- return the same blob of data with the same query key every time (read)
The difference to a a traditional key-value store is that the key doesn't get specified explicitly. Instead, the key gets calculated based on the data using a hashing function. This is also called content-addressed storage.
key == db.put(value)
value == db.get(key)
IPFS creates a cryptographically secure hash from the data you give it. You can then query the data with the hash:
const db = require('immutabledb-ipfs')
const value = 'Hello world!'
hash = db.put(value)
// 'QmUbbHGqBchN3bwaqevR3bcw9KjvANRi3PbbJP54qrkbMJ'
output = db.get(hash)
// 'Hello world!'
- immutabledb-mem
- immutabledb-ipfs
- immutabledb-redis
- immutabledb-levelup
immutabledb-ipfs
would look like this:Usage: