You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our current encryption/decryption layer sits on top of LevelDB. This causes problems for indexing #1 because when you want ot index something you'll need to expose keys, and keys have to be un-encrypted atm.
It may also increase performance of DB if encryption/decryption were operating at a block level rather at individual key-value level. It's the equivalent of using full-disk encryption and using leveldb on top.
We can't rely on OS provided full-disk encryption. So something that is in-between the current key-value DB like leveldb and the actual filesystem that is executed in JS or C++ would be needed.
There is a level-js which is a abstract-leveldown compliant store that can be wrapped in levelup. It is leveldb implemented in pure-JS which relies on IndexedDB. Currently IndexedDB doesn't exist natively on Node.js, but there are some implementations of it. This seems to give an opportunity to add a transparent encryption/decryption layer in between leveldb and IndexedDB.
Additional context
Integrate Automatic Indexing into DB #1 (comment) - RocksDB at the C++ level has provision for incorporating encryption at a low level (not sure if this still key-value level or block level of abstraction)
level is a library that bundles leveldown, level-js, levelup and encoding-down to create a single batteries-included package
the difference between leveldown and level-js is that leveldown uses the C++ leveldb library which only works in Node.js while level-js works on IndexedDB which exists in browsers
if IndexedDB were to exist in Node.js, one could use level-js as an isomorphic library that works on browsers and Node.js, not sure about NativeScript though
using IndexedDB could allow us to put a transparent encryption/decryption layer in between IndexedDB and level-js, thus enabling us flexible indexing, and probably better security
there are only 2 libraries providing IndexedDB in Node.js:
if fakeIndexedDB becomes realIndexedDB via leveldb, then this should be possible in NS as well, but you are doing something a bit funny: levelup API -> level-js -> transparent encryption/decryption -> IndexedDB -> leveldb or whatever, but this is sort of what happens in Chrome which implements IndexedDB using leveldb
- Attempt to implement or find a persistent IndexedDB, perhaps by being implemented by leveldb or sqlite, it seems like any performant implementation would have to use C++ at some point, also there are bunch of wrapper libraries, but not sure which ones actually perform real persistence
Specification
Our current encryption/decryption layer sits on top of LevelDB. This causes problems for indexing #1 because when you want ot index something you'll need to expose keys, and keys have to be un-encrypted atm.
It may also increase performance of DB if encryption/decryption were operating at a block level rather at individual key-value level. It's the equivalent of using full-disk encryption and using leveldb on top.
We can't rely on OS provided full-disk encryption. So something that is in-between the current key-value DB like leveldb and the actual filesystem that is executed in JS or C++ would be needed.
There is a
level-jswhich is a abstract-leveldown compliant store that can be wrapped in levelup. It is leveldb implemented in pure-JS which relies on IndexedDB. CurrentlyIndexedDBdoesn't exist natively on Node.js, but there are some implementations of it. This seems to give an opportunity to add a transparent encryption/decryption layer in between leveldb and IndexedDB.Additional context
levelis a library that bundlesleveldown,level-js,levelupandencoding-downto create a single batteries-included packageleveldownandlevel-jsis thatleveldownuses the C++ leveldb library which only works in Node.js whilelevel-jsworks on IndexedDB which exists in browsersIndexedDBwere to exist in Node.js, one could uselevel-jsas an isomorphic library that works on browsers and Node.js, not sure about NativeScript thoughIndexedDBcould allow us to put a transparent encryption/decryption layer in betweenIndexedDBandlevel-js, thus enabling us flexible indexing, and probably better securityIndexedDBin Node.js:fakeIndexedDBbecomesrealIndexedDBvia leveldb, then this should be possible in NS as well, but you are doing something a bit funny:levelup API -> level-js -> transparent encryption/decryption -> IndexedDB -> leveldb or whatever, but this is sort of what happens in Chrome which implementsIndexedDBusing leveldbTasks
IndexedDBIndexedDB, perhaps by being implemented by leveldb or sqlite, it seems like any performant implementation would have to use C++ at some point, also there are bunch of wrapper libraries, but not sure which ones actually perform real persistence