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
I'm assuming by different brand you refer to abstract-blob-store? There's a subtle but huge difference from abstract-blob-store: you don't handle the keys explicitly, but rather the DB handles the keys for you, ie. content-addressed vs. custom keys.
The rationale, and why I got to think this, is that in case of https://github.com/haadcode/ipfs-log IPFS is only used for object.put/get. If we can extract the common interface, we can enable
ipfs-log
to have any data storage backend (implementation) and as such allow the same append-only-log functionality with other DBs (as opposed to being locked in to IPFS). You could even do aimmutabledb-leveldb
wrapper that uses levelDB as the data storage.